microsoft / react-native-macos

A framework for building native macOS apps with React.
https://microsoft.github.io/react-native-windows/
MIT License
3.37k stars 129 forks source link

Cursor jumps on multiline text inputs #2127

Open AdrianFahrbach opened 1 month ago

AdrianFahrbach commented 1 month ago

Environment

react-native -v: v0.73.8
npm ls react-native-macos: v0.73.26
node -v: v20.12.1
npm -v: v10.5.0
yarn --version: not in use
xcodebuild -version: Xcode 15.4 Build version 15F31d

Steps to reproduce the bug

  1. Create a TextInput component
  2. Set its multiline prop to true
  3. Type in a few words and blur the input
  4. Now click on it again, somewhere in the middle of the text
  5. Type something and your cursor should jump to the end

Expected Behavior

The cursor should keep its position.

Actual Behavior

In the attached video I'm testing it with multiline true and false, two times each.

https://github.com/microsoft/react-native-macos/assets/45072099/955cc36a-8b48-4523-90cf-827873bd0c13

Reproducible Demo

You could test this in our Jira Time Tracker repository. However to make this work a .env file with a Jira API key as well as a Jira account are required. Send me a mail to adrianfahrbach@me.com and I can provide you with both.

Additional context

This could be related to #2066 and/or #2090.

Saadnajmi commented 1 month ago

Tried running Jira Time tracker through test flight, but don't have a Jira account (We use Azure Devops here at Microsoft :P), so I can't easily repro (will email though).

For the TextInput, are you setting the value property on it?

AdrianFahrbach commented 1 month ago

For the TextInput, are you setting the value property on it?

Yes, I'm setting the value through a state. The input in question is this one. Just answered your mail btw!