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

Detecting caret position/selection change and/or get caret position/selection #24713

Closed
CyberMew opened this issue May 6, 2019 · 3 comments
Closed
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@CyberMew
Copy link

CyberMew commented May 6, 2019

🐛 Bug Report

There is no way to track if a selection has been made or if the caret position has shifted, when the TextInput is already active (focused).

This is causing an issue if we needed the caret to always be on the far right end and this action shifts the caret/selection away.

There are no other callback functions being called when this event happens (do correct me if I am wrong).

To Reproduce

  1. Focus on a TextInput with some text.
  2. Get selection data from onSelectionChange or onFocus.
  3. Tap/Select on another portion of the text from the same TextInput.
  4. Now be frustrated when you can't get the new selection data.

Expected Behavior

onSelectionChange or onFocus should be called

Code Example

(too simple to re-create).

Environment

info
React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Memory: 9.25 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: ^0.59.5 => 0.59.5
npmGlobalPackages:
react-native-cli: 2.0.1

@react-native-bot
Copy link
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.59 and verify if the issue still exists.

The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.

@zhongwuzw
Copy link
Contributor

@CyberMew Hi, can you try #24714, is it works for you?

@zhongwuzw
Copy link
Contributor

I think this can close because we already fixes it. cc @kelset @cpojer.

@cpojer cpojer closed this as completed May 10, 2019
@facebook facebook locked as resolved and limited conversation to collaborators May 10, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants