mirror of
https://github.com/tappollo/booster.git
synced 2026-04-29 01:55:54 +08:00
fix: only change on focus
This commit is contained in:
@@ -17,14 +17,18 @@ export const openURL = async (url: string) => {
|
||||
export const useDisableToolbarOnFocus = () => {
|
||||
const isFocused = useIsFocused();
|
||||
useEffect(() => {
|
||||
KeyboardManager.setEnableAutoToolbar(!isFocused);
|
||||
if (isFocused) {
|
||||
KeyboardManager.setEnableAutoToolbar(false);
|
||||
}
|
||||
}, [isFocused]);
|
||||
};
|
||||
|
||||
export const useEnableKeyboardManagerOnFocus = () => {
|
||||
const isFocused = useIsFocused();
|
||||
useEffect(() => {
|
||||
KeyboardManager.setEnable(isFocused);
|
||||
if (isFocused) {
|
||||
KeyboardManager.setEnable(false);
|
||||
}
|
||||
}, [isFocused]);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user