Description
Describe the bug
editor.onChange(...)
event fires for indentation, but when you call context.getChanges(), the array of changes is empty.
To Reproduce
- open this simple reproduction
- create two blocks
- open the devtools console
- try to indent the 2nd block
You'll see the an empty array of changes, which is something I didn't expect.
Same problem applies when dragging & dropping a block to rearrange its position.
Context
I was prototyping and playing around with BlockNote to see its capabilities, and was hoping it would be possible to create a sync system using the onChange hook (to autosave the blocks in a DB).
I know I can also access the underlying ProseMirror transactions, but I was under the impression onChange would be the better level of abstraction, as it is aware of block IDs. Let me know if I'm approaching this wrong.
Looks like maybe the function here:
BlockNote/packages/core/src/api/nodeUtil.ts
Line 158 in 95a72b7
doesn't support indentation or block move changes?
Misc
- Node version: N/A
- Package manager: N/A
- Browser: Chromium 137.0.7151.69
- I'm a sponsor and would appreciate if you could look into this sooner than later 💖