Move Keyboard focus #96
-
Good morning, KeyboardExtendedModule.setKeyboardFocus(ref) but it does not seem to be working; I've read that there's no iOS support for managing the keyboard only focus, so I'm unsure if I'm doing something wrong or it can't be achieved Any help/suggestion is appreciated, thank you |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @consuelo-sanna, The current way to manage focus is: import { useRef } from 'react';
import { Button } from 'react-native';
import {
BaseKeyboardView,
type KeyboardFocus,
} from 'react-native-external-keyboard';
export const Example = () => {
const ref = useRef<KeyboardFocus>(null);
const action = () => {
ref.current?.focus();
};
return (
<BaseKeyboardView ref={ref}>
<Button title="Target" />
</BaseKeyboardView>
);
}; You can use BaseKeyboardView or explore the features of KeyboardFocusView and withKeyboardFocus. Unfortunately, focus control via the module KeyboardExtendedModule.setKeyboardFocus had some limitations and has been deprecated and removed. While there are ideas about how to implement setKeyboardFocus properly with the module, it is not currently in my plans. Regards, |
Beta Was this translation helpful? Give feedback.
-
Hello @consuelo-sanna, |
Beta Was this translation helpful? Give feedback.
Hello @consuelo-sanna,
The current way to manage focus is:
You can use BaseKeyboardView or explore the features of KeyboardFocusView and withKeyboardFocus.
Unfortunately, focus control via the module KeyboardExtendedModule.setKeyboardFocus had some limitations and has been deprecated and remov…