Closed byTimo closed 1 year ago
Latest commit: 87b8fa7b8a762a8cdae7998ea1f66cff7addd980
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-mentions | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 29, 2023 0:18am |
The fix for native undo/redo (only a plain text) in case the input was not focused before the operation.
Steps to reproduce:
ctrl
+z
/cmd
+z
Technically, the problem happens, because for such undo/redo operations
onChange
handler is called beforeonSelect
, hencethis.state.selectionStart
andthis.state.selectionEnd
arenull
and the next value is calculated incorrectly, based on what there was before the operation and the value that should be set after one