-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Here is a code sandbox demonstrating the issue
Position your cursor at the first character of the TextInput and type a several times
Note that while the first appeared at the correct location, afterwards the cursor jumps to the end and you end up with something like afooaa. My guess is that the input is (incorrectly) re-mounting.
I'm using this very simple component
import React, { useState } from "react";
import { Portal, TextInput, Provider } from "react-native-paper";
export default () => {
const [data, setData] = useState(`foo`);
return (
<Provider>
<Portal>
<TextInput value={data} onChangeText={setData} />
</Portal>
</Provider>
);
};
When not inside of a Portal this works fine.
It also sometimes works fine even in a Portal, I have a team member that tried to fix this issue by modifying our code, and actually got it working from inside a Portal by introducing a ton of duplication and awkward state. I have not been able to narrow down what exactly makes it work again, but this reduced test case shows the incorrect behavior regardless.