Skip to content

Commit

Permalink
Continue event processing only if within a specific element
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed May 16, 2023
1 parent 240a32b commit 744a466
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export function useFirefoxCompat( props ) {
return;
}

if ( element.closest( 'button, summary' ) === null ) {
return;
}

const { value, onChange } = propsRef.current;
onChange( insert( value, ' ' ) );
event.preventDefault();
Expand Down

0 comments on commit 744a466

Please sign in to comment.