Open gaeldestrem opened 5 months ago
By debugging the native code, the method RCTTextInputComponentView > _setAttributedString
doesn't seem implemented for the macos platform.
Adding these two lines seems to fix the issue. It's probably not the right fix but it might help to investigate :)
Here's is the patch and a record
react-native-macos+0.73.13.patch
https://github.com/microsoft/react-native-macos/assets/5053593/fefe5f3c-4830-4ec0-92af-f6b443139446
Sorry for not updating sooner. Our Fabric implementation is still experimental, so I expect bugs like this one to be everywhere :). We should be pushing a bunch of Fabric changes soon, and I'll keep this issue in mind! @shwanton fyi
Environment
Steps to reproduce the bug
Issue:
When using Fabric and having a component TextInput with the following definition:
Calling the method clearTextInput doesn't clear the UI value.
https://github.com/microsoft/react-native-macos/assets/5053593/741f14b6-b49a-42ef-9b8b-c2c34fcbca1d
Expected Behavior
I would expect the same behavior than when using a TextInput with Chakra:
value
: Old Arch ✅ / Fabric ❌inputRef.current.clear()
: Old Arch ✅ / Fabric ❌inputRef.current.setNativeProps({text: ''})
: Old Arch ✅ / Fabric ❌Reproducible Demo
https://github.com/gaeldestrem/rnrepro