Skip to content
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

[bug] When a TextInput is inside a Portal, cursor jumps around on edit #58

Closed
lovegaoshi opened this issue Jun 1, 2023 · 3 comments · Fixed by #59 or #61
Closed

[bug] When a TextInput is inside a Portal, cursor jumps around on edit #58

lovegaoshi opened this issue Jun 1, 2023 · 3 comments · Fixed by #59 or #61

Comments

@lovegaoshi
Copy link
Owner

exactly this issue. doesnt just happen to react-native-paper's portal but other kinds of portals too like react-native-portal.

@lovegaoshi
Copy link
Owner Author

i forgot which issue it was acutally mentioned, but the root cause is I cannot use states directly in the same component wrapped in a portal. it has to be wrapped inside another component to please this cursor flickering problem. however a dialog does need access to the textinput value and this will be resolved via refs, similar to how i was too lazy to lift the state up for addPlaylistButton.

@lovegaoshi
Copy link
Owner Author

react-native-paper's input as ref does not seem to expose value, this is logging the ref.current object:
{"blur": [Function blur], "clear": [Function clear], "focus": [Function focus], "forceFocus": [Function forceFocus], "isFocused": [Function isFocused], "setNativeProps": [Function setNativeProps]}

so we cant exactly use uncontrolled props here

@lovegaoshi
Copy link
Owner Author

why cant i just wrap the entire dialog into another component? using ref sounds unnecessarily convoluted and stupid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant