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
787 stars 56 forks source link

Fix replacing default element in undo history #348

Closed Skalakid closed 4 months ago

Skalakid commented 4 months ago

Details

This PR fixes the bug when pasting text into composer before the page fully loads and the default history item is replaced

Related Issues

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

Manual Tests

[!NOTE]
Issues are mostly reproducible in E/App

Unable to undo pasted text issue

  1. Reload the app
  2. Paste text quickly into auto-focused markdown input
  3. Undo it by clicking Ctrl + Z
  4. Verify if the text was undone and if you can redo the changes

Wrong history index after repeating paste and undo

  1. Open the app
  2. Paste text into
  3. Undo it by clicking Ctrl + Z
  4. Paste text into
  5. Undo it by clicking Ctrl + Z, verify if the text was undone
  6. Go to step 2 and repeat

Linked PRs

https://github.com/Expensify/react-native-live-markdown/pull/342