Related to this issue
I’m trying to get the index of a child block within a parent, to use in the php rendering as a tab index.
Attempting to add this code to the Child itself, so on save it can assign the current child’s index within the parent as an attribute for use in the PHP template.
const index = select( 'core/block-editor' ).getBlockIndex( clientId );
This is constantly returning -1
, even though the clientId
is unique across blocks. Any suggestions/help?