-
Notifications
You must be signed in to change notification settings - Fork 23
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
TextInput inside a portal is buggy #6
Comments
Hi, Indeed this issue is very weird. Did you try with I tried it with the following: npx create-react-native-app test
cd test
yarn start
yarn ios # other tab App.js import React, { useState } from 'react';
import { TextInput } from 'react-native';
import { Portal, Host } from 'react-native-portalize';
export default () => {
const [data, setData] = useState('foo');
return (
<Host>
<Portal>
<TextInput style={{ top: 200 }} value={data} onChangeText={setData} />
</Portal>
</Host>
);
}; and it works as expected. (Also, you have to use Host component and not Provider when using Have you tried using TextInput from |
this issue still exists. |
I changed my plan for my app so I no more use Portalize (use a modal instead).
Thank's @jeremybarbet for your work :) |
I confirm the bug. I am using TextInput from react-native |
This issue also affect when input with Chinese languages. The workaround cannot solve. Here is the demo: There is no problem when both TextInput are placed without Portal. |
I'm having the same issue |
The issue occurs when you use portal in component, which control input by state. As workaround, i made HOC for portal:
Then, i can use it like this:
If component, which makes textinput value updates, is inside portal it works as it should |
try this:
|
Still encounter the same issue when using The text input glitch like @hermanho provided demo video.
|
This is still an issue. When selecting an input that opens the keyboard outside the modal, then selecting an input inside the portal that opens the keyboard and you close the keyboard, the whole layout gets screwed up. |
if you still have an problem with multiline prop use defaultValue={text} instead of value={text} |
OMG @mertcankose how was that so simple? Thank you, fixed my problem. |
Hi,
I use this plugin to have a beautiful shadow (all screen) behind a bottom sheet (https://github.com/osdnk/react-native-reanimated-bottom-sheet).
I have some textinput inside, but the cursor is buggy they are in the Portal.
This is the exact same issue than him :
callstack/react-native-paper#1668
He found a hack but it seems... terrible.
Any idea to correct the problem?
Thank's !
The text was updated successfully, but these errors were encountered: