Expensify / react-native-live-markdown

Drop-in replacement for React Native's TextInput component with Markdown formatting.
https://www.npmjs.com/package/@expensify/react-native-live-markdown
MIT License
781 stars 56 forks source link

feat: add count/before/start info to `onChange` event #412

Closed hannojg closed 2 months ago

hannojg commented 3 months ago

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:

Here are a few examples to better understand this:

Second example:

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

github-actions[bot] commented 3 months ago

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

hannojg commented 3 months ago

I have read the CLA Document and I hereby sign the CLA

hannojg commented 3 months ago

recheck

BartoszGrajdek commented 2 months ago

I haven't found any regressions 👍🏻