beta: undo of slate content no longer works
macrozone opened this issue Β· comments
Describe the bug
undo no longer works properly for slate on the beta version, where we updated to the newest slate/slate-react
reason is that slate change the meaning of value
, its no longer to set the value (as conventions dictate). Instead it only sets the initialValue, which makes slate harder to control. (see also ianstormtaylor/slate#4992)
At this point its unclear to how to fix it, slate integration was always a bit tricky and our integration is also a bit hacky with the debouncing. I have to figure out how to do this more cleanly
π This issue has been resolved in version 4.10.0-beta.4 π
The release is available on:
v4.10.0-beta.4
- GitHub release
Your semantic-release bot π¦π
π This issue has been resolved in version 4.11.0-beta.1 π
The release is available on:
v4.11.0-beta.1
- GitHub release
Your semantic-release bot π¦π
π This issue has been resolved in version 4.11.0 π
The release is available on:
v4.11.0
- GitHub release
Your semantic-release bot π¦π
Looking at the commit where this was fixed, ed7d2b8#diff-b3b7bde30c2e6e9f379e434183f8f71935c64d61d22d236d092e3c7726131b84R57 - should useCallback also have a data dependency on data?.selection
? If any external system were to change the data.selection
, I think the old value of the data.selection might be bound to the memoized version of the callback, which might cause glitches down the road?
Looking at the commit where this was fixed, ed7d2b8#diff-b3b7bde30c2e6e9f379e434183f8f71935c64d61d22d236d092e3c7726131b84R57 - should useCallback also have a data dependency on
data?.selection
? If any external system were to change thedata.selection
, I think the old value of the data.selection might be bound to the memoized version of the callback, which might cause glitches down the road?
could be, but i am not sure. Tbh. its a still a bit "magic" and not 100% clean. There were some glitches with slate and that solution worked properly.
it indeed still works with external updates, in fact undo/redo are external and will also update the selection as long as the content changed as well (selection updates should not add to the undo stack anyway)