-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: add count/before/start info to onChange
event
#412
feat: add count/before/start info to onChange
event
#412
Conversation
To align with react native, see: facebook/react-native#45248
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
recheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, I will run some tests now to check if there's no regressions 👀
I haven't found any regressions 👍🏻 |
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
onChange
event 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 (the0
was added)before
: 2 (the text replacedll
had a length of2
)This PR adds the same range info when we fire a
onChange
event.Related Issues
Expensify/App#37896
Manual Tests
Still need to add (will do tmrw) - can I maybe get a code review first?
Linked PRs