feat: add count/before/start info to onChange event#412
Merged
Skalakid merged 3 commits intoExpensify:mainfrom Jul 9, 2024
Merged
feat: add count/before/start info to onChange event#412Skalakid merged 3 commits intoExpensify:mainfrom
onChange event#412Skalakid merged 3 commits intoExpensify:mainfrom
Conversation
To align with react native, see: facebook/react-native#45248
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
Author
|
recheck |
61 tasks
BartoszGrajdek
approved these changes
Jul 9, 2024
Contributor
BartoszGrajdek
left a comment
There was a problem hiding this comment.
Code LGTM, I will run some tests now to check if there's no regressions 👀
Contributor
|
I haven't found any regressions 👍🏻 |
This was referenced Jul 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
As part of an effort to fix a long standing bug in expensify / react-native's text input I need to update the web implementation to work as the react-native's native change:
Goal: align with:
In this PR the
onChangeevent is send with the range in which the new changes occurred. The range is encoded as three values:start: The position in the new text where the changes started occuringcount: The length of the newly changed textbefore: The length of the text before the changes.Here are a few examples to better understand this:
start: 5 (end of Hello)count: 1 (the!was added)before: 0 (no text was replaced)Second example:
start: 2 (after thee)count: 1 (the0was added)before: 2 (the text replacedllhad a length of2)This PR adds the same range info when we fire a
onChangeevent.Related Issues
Expensify/App#37896
Manual Tests
Still need to add (will do tmrw) - can I maybe get a code review first?
Linked PRs