editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Fixed incorrect identify of the current block if a nested editor is used in it

Open VolgaIgor opened this issue 2 months ago • 0 comments

Hello! I have noticed a problem that when using a nested editor in a block, the parent editor stops correctly identifying the current block when hovering over or clicking on the nested editor block.

Example: unnormal

You can see that the toolbox menu jumps when you hover or click on the nested editor. This happened because in hover/click events, all editors in the chain received the block of the lower-level editor in which the event occurred. So the top-level editors could not correctly determine in which block of their instance the event occurred.

I fixed this bug by making a function that determines the block belonging to a current editor instance when an event occurs for each editor in the nesting chain.

Example after fix: normal

  • The example used the Spoiler block, but the problem was relevant for any case of using a nested editor

VolgaIgor avatar Nov 13 '25 09:11 VolgaIgor