You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[New Arch] TextInput text change flickers if within Portal #4580
Under new arch any TextInput component (be it from react-native-paper or from react-native) within Portal (modal or dialog) will flicker when text is being changed.
For the time being I decided to just use standard react-native modal and add semi-transparrent background etc (bugs like that must not stop from going to prod), might actually stick to this as it's much simpler than paper approach:
Thanks for suggestion. No I haven't. And I probably won't. I am reporting the bug here so that it can be tracked. I won't be using paper's Modals/Portals. I decided in favour of my alternative approach above.
Reacted by Antonio Henrique, Kamto Eddy and Maksym Shcherban
I had the same issue, for me the flickering does not happen, when not passing value to the TextInput instead only passing onChangeText as in the example from @tonihm96 but is also works without using a ref
I remember encountering this issue about a year ago, I opted for uncontrolled TextInput back then. Just ran into this in another application. I guess it hasn't been solved yet...
Trying to "upgrade" my text input modals to match our other modal implementations with react-native-paper and then spent the day debugging why my text inputs are continuously flickering:
flicker.mov
The flicker does not occur if I don't use a Portal component. Nor does it happen if I use Portal.Host.
onChangeText is being called repeatedly with the new value, then the original, then the new, ad infinitum.
My component code:
exportconstTextAreaModal: FC<TextAreaModalProps>=(props)=>{const{
isVisible,
setModalVisible,
onSaveText,
value ="",}=propsconst[localText,setLocalText]=useState(value)constonChangeText=(text)=>{console.log("onChangeText",text)setLocalText(text)}constcloseModal=()=>{onSaveText?.(localText)setModalVisible?.(false)}return(<Portal><Modalvisible={isVisible}onDismiss={closeModal}contentContainerStyle={styles.modalContentContainer}testID="modal-component"style={styles.modal}theme={{isV3: false}}><Viewstyle={styles.modalBody}><TextInputonChangeText={onChangeText}value={localText}autoFocusplaceholder="Write a note..."multilinestyle={styles.textWrapper}inputStyle={styles.textInput}/></View></Modal></Portal>)}
Activity
Ademivaldo commentedon Dec 20, 2024
same problem
BrandonHowe commentedon Dec 26, 2024
Same problem. Does anyone know a fix?
codan84 commentedon Dec 26, 2024
There's no fix atm afaik
codan84 commentedon Jan 2, 2025
For the time being I decided to just use standard react-native modal and add semi-transparrent background etc (bugs like that must not stop from going to prod), might actually stick to this as it's much simpler than paper approach:
tonihm96 commentedon Jan 3, 2025
Have you tried using a ref to store text input instead?
codan84 commentedon Jan 4, 2025
Thanks for suggestion. No I haven't. And I probably won't. I am reporting the bug here so that it can be tracked. I won't be using paper's Modals/Portals. I decided in favour of my alternative approach above.
Prajwaltechversant commentedon Jan 30, 2025
I am having the same issue with the new architecture,
"react-native-paper": "^5.13.1",
"react-native": "0.76.6",
MarcusLorenzana commentedon Feb 20, 2025
Same issue with me on latest react-native-paper.
Blubl commentedon Mar 12, 2025
I had the same issue, for me the flickering does not happen, when not passing
valueto theTextInputinstead only passingonChangeTextas in the example from @tonihm96 but is also works without using a refmaxymczech commentedon Mar 30, 2025
I remember encountering this issue about a year ago, I opted for uncontrolled
TextInputback then. Just ran into this in another application. I guess it hasn't been solved yet...FSpark commentedon May 22, 2025
It seems that this won't happen after upgrading to Expo 53.
jfries289 commentedon May 30, 2025
Trying to "upgrade" my text input modals to match our other modal implementations with
react-native-paperand then spent the day debugging why my text inputs are continuously flickering:flicker.mov
The flicker does not occur if I don't use a
Portalcomponent. Nor does it happen if I usePortal.Host.onChangeTextis being called repeatedly with the new value, then the original, then the new, ad infinitum.My component code:
jfries289 commentedon Jul 15, 2025
@lukewalczak Can we get some 👀 on this? This issue keeps popping up for us.
One further detail, it appears to only happen when
multilineis on.jerrym7 commentedon Aug 31, 2025
Try autoCorrect={false}
markendy commentedon May 25, 2026
Progress never stands still, so perhaps the new solution described in this question will help you! https://stackoverflow.com/questions/79253174