Repository navigation
Conversation
| if ( ! hasSyncedValue ) { | ||
| this.syncedValue = blocks; | ||
| console.log( 'input' ); | ||
| onInput( blocks ); |
There was a problem hiding this comment.
I'm trying to understand how this is supposed to work but I don't understand yet. In my testing in the previous PR, if you call onInput or onChange in componentDidUpdate, it will only be called once with the last value if you call them synchronously in RichText. which breaks "backticks undo" for instance (curious to know the result of this particular e2e test in this PR)
|
The history management changed a lot since this PR was started. I'm not sure if this PR is still relevant? |
|
I think it's still relevant, at least in how the |
Related: #13088
This pull request seeks to explore consider improvements to blocks history management. Particularly, it seeks to address a point raised at #13088 (comment) where trying to create an undo level explicitly within the same dispatch may fail when the next state is equal to current. The implementation of
withHistoryis such that it expects an undo level creation to be a separate action, in this case immediately preceding the action which incurs the change (onChangecallingresetEditorBlocks).cc @iseulde in case you have some feedback here, since I think you originally implemented the explicit "create undo level" mechanism.
Separate explorations in a3aa1e5 , while not directly related, were the original changes considered here. It may make sense to fork these off separately. They were motivated by a desire to understand what was meant in a comment about "avoiding batching changes" with a subscriber within
BlockEditorProvider.