Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add enableKeyboardHandling in example
Browse files Browse the repository at this point in the history
IvanIhnatsiuk committed Feb 1, 2024
1 parent 522804e commit 875440b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example/src/screens/Examples/AwareScrollView/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useIsFocused } from "@react-navigation/native";
import React, { useEffect, useState } from "react";
import { Text } from "react-native";
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
@@ -15,6 +16,8 @@ export default function AwareScrollView({ navigation }: Props) {
const [disableScrollOnKeyboardHide, setDisableScrollOnKeyboardHide] =
useState(false);

const isFocused = useIsFocused();

useEffect(() => {
navigation.setOptions({
headerRight: () => (
@@ -33,6 +36,7 @@ export default function AwareScrollView({ navigation }: Props) {
<KeyboardAwareScrollView
testID="aware_scroll_view_container"
bottomOffset={50}
enableKeyboardHandling={isFocused}
disableScrollOnKeyboardHide={disableScrollOnKeyboardHide}
style={styles.container}
contentContainerStyle={styles.content}

0 comments on commit 875440b

Please sign in to comment.