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
670 stars 45 forks source link

Fix Live Markdown Input undo/redo history on web #342

Closed Skalakid closed 1 month ago

Skalakid commented 2 months ago

Details

This PR enhances undo/redo history logic. The main changes are:

Related Issues

https://github.com/Expensify/App/issues/39255

Manual Tests

  1. Copy and paste text into Live Markdown Input somewhere else than the end of the value inside
  2. Try to undo it immediately after pasting it
  3. Verify if text was undone and if cursor position was set it the place where the undo text was beginning

Linked PRs

BartoszGrajdek commented 1 month ago

One small bug - cursor position is incorrect here after undo

Video https://github.com/Expensify/react-native-live-markdown/assets/41169160/490c3c85-c3a4-41d2-9e27-5e42c0ba3454
Skalakid commented 1 month ago

@BartoszGrajdek I can't reproduce this issue, did you pull the latest changes?