Skip to content

Commit

Permalink
Block editor: rich text: return early if __experimentalUndo is not de…
Browse files Browse the repository at this point in the history
…fined (#46152)
  • Loading branch information
ellatrix authored Nov 30, 2022
1 parent 41b0e39 commit c197dcf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ export function useUndoAutomaticChange() {
return;
}

const { __experimentalUndo } = getSettings();

if ( ! __experimentalUndo ) {
return;
}

if ( ! didAutomaticChange() ) {
return;
}

event.preventDefault();
getSettings().__experimentalUndo();
__experimentalUndo();
}

element.addEventListener( 'keydown', onKeyDown );
Expand Down

0 comments on commit c197dcf

Please sign in to comment.