Open skorasaurus opened 3 years ago
I've did some digging and have found out that just before the crash the getSelectedBlockCount
returns 1
, getMultiSelectedBlocks
returns single element array with some block entity, but the getSelectedBlock
for some reason returns null
.
As a workaround i've changed the logic to use getMultiSelectedBlocks
unconditionally near
https://github.com/justintadlock/block-pattern-builder/blob/f14564dcce8166cc02810f238487eb3ab1e0751c/resources/js/editor.js#L34
and as for now it seems to work good, but I'm not familiar with gutenberg API to any extent, so I'm not really sure what are eventual side effects of such a change.
After creating a group block and a user attempts to select more blocks, the block-pattern-builder plugin causes the editor to crash.
To reproduce:
I've been able to reproduce this across Gutenberg 9.1 and 9.4.1.
I've deactivated all other plugins except the block-pattern-builder. I'm unable to reproduce this if I deactivate the block-pattern-builder plugin.
I think what could be of note is the following line which is in the console.log
render/S<@https://local.wordpress.test/wp-content/plugins/block-pattern-builder/public/js/editor.js?id=0fa3860205cf6b634f29:1:2467
The full console log is below:
render/S<@https://local.wordpress.test/wp-content/plugins/block-pattern-builder/public/js/editor.js?id=0fa3860205cf6b634f29:1:2467
character 2467, expanded out is before
u(l)
When I beautified, that out, the surrounding code is: