Closed zyslife closed 3 months ago
Thanks @zyslife
I can reproduce the problem 👍
@zyslife can you check if https://github.com/kirillzyusko/react-native-keyboard-controller/pull/491 fixes the problem for you? 👀
@zyslife can you check if #491 fixes the problem for you? 👀
Yes, it has been resolved. Thank you very much for your quick response. However, there is still an optimization point. Currently, when the cursor moves to a new line, the onSelectionChange of useFocusedInputHandler is called twice. The first time, it's startY: -1, endY: 1, and the second time, it's normal. Could it be called only once in a normal way?
Currently, when the cursor moves to a new line, the onSelectionChange of useFocusedInputHandler is called twice. The first time, it's startY: -1, endY: 1, and the second time, it's normal. Could it be called only once in a normal way?
@zyslife In my case it's called once and I don't see startY: -1, endY: 1
anymore. Here is logs from the app:
LOG {"eventName": "onFocusedInputSelectionChanged", "selection": {"end": {"position": 41, "x": 353.3333333333333, "y": 22.666666666666668}, "start": {"position": 41, "x": 351.3333333333333, "y": 4}}, "target": 513}
LOG {"eventName": "onFocusedInputSelectionChanged", "selection": {"end": {"position": 42, "x": 21.333333333333332, "y": 39.333333333333336}, "start": {"position": 42, "x": 19.333333333333332, "y": 20.666666666666668}}, "target": 513}
I've published 1.12.5
and I think the problem has been fixed there!
If not - let me know and I'll re-open this issue!
I've published
1.12.5
and I think the problem has been fixed there!If not - let me know and I'll re-open this issue!
Yes, I have verified in the latest version, and the issue has been resolved.
Describe the bug When the TextInput is multiline and scrollEnabled={false}, and there is no height restriction, the start and end values are incorrect when a line break occurs. For more details, please refer to the screenshot and code example below.
Please replace the FocusedInputHandlers example.
Code snippet
Screenshots ![Uploading Xnip2024-07-03_11-04-19.jpg…]()
Smartphone (please complete the following information):