Skip to content

Commit

Permalink
Rich text: enable if multi selection is aborted (#19839)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix authored and talldan committed Jan 24, 2020
1 parent 5275570 commit 17ef62d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ export default function useMultiSelection( ref ) {
const onSelectionChange = useCallback( ( { isSelectionEnd } ) => {
const selection = window.getSelection();

// If no selection is found, end multi selection.
// If no selection is found, end multi selection and enable all rich
// text areas.
if ( ! selection.rangeCount || selection.isCollapsed ) {
toggleRichText( ref.current, true );
return;
}

Expand Down

0 comments on commit 17ef62d

Please sign in to comment.