-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to get input cursor x, y
coordinate?
#361
Comments
x, y
coordinatex, y
coordinate?
Yes, it should be possible to extend the native code so that |
Hey @ehxxn You can use https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/hooks/input/use-focused-input-handler#onselectionchange to get If you want to extend const CustomTextInput = (props) => {
const ref = useRef();
const [tag, setTag] = useState(-1);
useEffect(() => {
setTag(findNodeHandle(ref));
}, []);
useFocusedInputHandler({
onSelectionChange: (e) => {
"worklet";
if (e.target === tag) {
runOnJS(props.customPropHandler)(e);
}
}
}, [tag]);
return <TextInput ref={ref} {...props} />
} You may check example app to see how it works in action 👀 |
Thank you very much! I'll try those solutions |
@ehxxn if you discover, that something is not working or find any bugs - feel free to open new issue in keyboard-controller repository 🙌 |
No description provided.
The text was updated successfully, but these errors were encountered: