Skip to content

Conversation

@scrapooo
Copy link
Contributor

@scrapooo scrapooo commented Oct 1, 2025

onValueChange was not triggered when replacing text after selecting it from right to left

Description

onValueChange was not triggered when replacing text after selecting it from right to left, while selecting text from left to right works as expected. This inconsistency occurs because getTargetRanges cannot detect the direction of the user's selection.

Issue
Fixes: #5955

Example

onValueChange.not.trigger.mov

Context
If your change is non-trivial, please include a description of how the new logic works, and why you decided to solve it the way you did. (This is incredibly helpful so that reviewers don't have to guess your intentions based on the code, and without it your pull request will likely not be reviewed as quickly.)

Checks

  • The new code matches the existing patterns and styles.
  • The tests pass with yarn test.
  • The linter passes with yarn lint. (Fix errors with yarn fix.)
  • The relevant examples still work. (Run examples with yarn start.)
  • You've added a changeset if changing functionality. (Add one with yarn changeset add.)

@changeset-bot
Copy link

changeset-bot bot commented Oct 1, 2025

🦋 Changeset detected

Latest commit: 013cb93

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
slate-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dylans dylans merged commit bd66bfa into ianstormtaylor:main Oct 24, 2025
11 checks passed
@github-actions github-actions bot mentioned this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

onValueChange not triggered when selecting text from right to left then input

2 participants