Skip to content

Commit

Permalink
Fix failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 23, 2023
1 parent ff40e15 commit 150f638
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function findSelection( blocks ) {
blocks[ i ].attributes[ attributeKey ] = blocks[ i ].attributes[
attributeKey
].replace( START_OF_SELECTED_AREA, '' );
return blocks[ i ].clientId;
return [ blocks[ i ].clientId, attributeKey, 0, 0 ];
}

const nestedSelection = findSelection( blocks[ i ].innerBlocks );
Expand All @@ -38,6 +38,8 @@ function findSelection( blocks ) {
return nestedSelection;
}
}

return [];
}

export function useInputRules( props ) {
Expand Down Expand Up @@ -86,9 +88,11 @@ export function useInputRules( props ) {
} );
const block = transformation.transform( content );

selectionChange( findSelection( [ block ] ) );
selectionChange( ...findSelection( [ block ] ) );
onReplace( [ block ] );
__unstableMarkAutomaticChange();

return true;
}

function onInput( event ) {
Expand All @@ -106,7 +110,7 @@ export function useInputRules( props ) {
}

if ( __unstableAllowPrefixTransformations && inputRule ) {
inputRule();
if ( inputRule() ) return;
}

const value = getValue();
Expand Down

0 comments on commit 150f638

Please sign in to comment.