Closed hannojg closed 2 months ago
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:
onChange
start
count
before
Here are a few examples to better understand this:
!
Second example:
e
0
ll
2
This PR adds the same range info when we fire a onChange event.
https://github.com/Expensify/App/issues/37896
Still need to add (will do tmrw) - can I maybe get a code review first?
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
recheck
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
https://github.com/Expensify/App/issues/37896
Manual Tests
Still need to add (will do tmrw) - can I maybe get a code review first?
Linked PRs