Open shiz-ceo opened 1 month ago
core, pm/commands
2.7.3
Wen you toggle heading or other block, that change Node type, id recretates. This affect by: setBlockType from @tiptap/pm/commands.
setBlockType
@tiptap/pm/commands
When user toggle or set node, we need to copy current attrs to new node.
Chrome
https://tiptap.dev/docs/editor/extensions/functionality/uniqueid
paragraph id: cdaa15d5-f2ee-44a0-8fac-07377ded3676 toggle paragraph -> heading heading id: cdaa15d5-f2ee-44a0-8fac-07377ded3676 toggle heading -> paragraph paragraph id: cdaa15d5-f2ee-44a0-8fac-07377ded3676
cdaa15d5-f2ee-44a0-8fac-07377ded3676
paragraph id: cdaa15d5-f2ee-44a0-8fac-07377ded3676 toggle paragraph -> heading heading id: 0f3f33dd-5d18-4f7e-b4d2-0730303ab032 toggle heading -> paragraph paragraph id: 4df14d82-6983-4206-968f-be0d261ebbc1
0f3f33dd-5d18-4f7e-b4d2-0730303ab032
4df14d82-6983-4206-968f-be0d261ebbc1
Related functions & urls: https://github.com/ueberdosis/tiptap/blob/develop/packages/core/src/commands/toggleNode.ts#L26
https://github.com/ueberdosis/tiptap/blob/develop/packages/core/src/commands/setNode.ts#L21
Affected Packages
core, pm/commands
Version(s)
2.7.3
Description of the Bug
Wen you toggle heading or other block, that change Node type, id recretates. This affect by:
setBlockType
from@tiptap/pm/commands
.When user toggle or set node, we need to copy current attrs to new node.
Browser Used
Chrome
Code Example (Preferred)
https://tiptap.dev/docs/editor/extensions/functionality/uniqueid
Expected Behavior
paragraph id:
cdaa15d5-f2ee-44a0-8fac-07377ded3676
toggle paragraph -> heading heading id:cdaa15d5-f2ee-44a0-8fac-07377ded3676
toggle heading -> paragraph paragraph id:cdaa15d5-f2ee-44a0-8fac-07377ded3676
Additional Context (Optional)
Current behavior:
paragraph id:
cdaa15d5-f2ee-44a0-8fac-07377ded3676
toggle paragraph -> heading heading id:0f3f33dd-5d18-4f7e-b4d2-0730303ab032
toggle heading -> paragraph paragraph id:4df14d82-6983-4206-968f-be0d261ebbc1
Related functions & urls: https://github.com/ueberdosis/tiptap/blob/develop/packages/core/src/commands/toggleNode.ts#L26
https://github.com/ueberdosis/tiptap/blob/develop/packages/core/src/commands/setNode.ts#L21
Dependency Updates