Skip to content
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 doesn't retain text selection when font style changes #31375

Closed
apfritts opened this issue Apr 17, 2021 · 3 comments
Closed

TextInput doesn't retain text selection when font style changes #31375

apfritts opened this issue Apr 17, 2021 · 3 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@apfritts
Copy link

apfritts commented Apr 17, 2021

Description

When a user taps on a TextInput field, we'd like to change the border color and font style so that the user can easily see where they are typing. When changing the border style, the selected text in TextInput remains the same. When changing the font style, the selection is lost and the cursor moves to the end of the TextInput.

React Native version:

$ yarn react-native info
yarn run v1.22.10
$ /Users/apfritts/Software/LovebugAdmin/node_modules/.bin/react-native info
info Fetching system and libraries information...
System:
    OS: macOS 11.2.3
    CPU: (8) arm64 Apple M1
    Memory: 71.77 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.12.0 - /var/folders/_2/w82mgfxd6wbbmv6njlk1fv4m0000gn/T/yarn--1618678732532-0.19761960273155532/node
    Yarn: 1.22.10 - /var/folders/_2/w82mgfxd6wbbmv6njlk1fv4m0000gn/T/yarn--1618678732532-0.19761960273155532/yarn
    npm: 7.6.3 - ~/.nvm/versions/node/v15.12.0/bin/npm
    Watchman: 4.9.0 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /Users/apfritts/.rvm/gems/ruby-2.7.2/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 28, 29
      Build Tools: 29.0.2
      System Images: android-24 | Google APIs ARM 64 v8a, android-29 | Google APIs Intel x86 Atom_64, android-S | Google Play ARM 64 v8a
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7199119
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_282 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^17.0.2 => 17.0.2
    react-native: 0.64.0 => 0.64.0
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
✨  Done in 7.06s.

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Launch emulator for iOS
  2. With border and font style changes activated, tap "Next Input"
  3. Notice the cursor moves to the end of the TextInput
  4. Deactivate font style changing.
  5. Tap "Next Input"
  6. Notice the entire text field is selected

Deactivating or activating border style changes have no effect on selection behavior.

Expected Results

I expect the text to remain selected even when the font style changes.

Snack, code example, screenshot, or link to a repository:

This only affects iOS. Make sure you run this example using an iOS emulators.
https://snack.expo.io/@apfritts/textinput-focus-bug

Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 30, 2023
Copy link

github-actions bot commented Jan 6, 2024

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Jan 6, 2024
@fabOnReact
Copy link
Contributor

Do you still experience this issue?

I have four years of experience maintaining facebook/react-native and I specialize in the Text and TextInput components. I currently have 58 facebook/react-native PRs.

If you still experience this issue, I will prepare a patched release with the fix.

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants