Skip to content

Commit

Permalink
Attempt to avoid DOM selector, check failures again
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 14, 2024
1 parent 4c2ec17 commit 8579290
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ export function RichTextWrapper(
return;
}

// Writing flow might be editable, so we should make sure focus goes to
// the root editable element.
while ( element.parentElement?.isContentEditable ) {
element = element.parentElement;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ export default function useSelectAll() {
const selectedClientIds = getSelectedBlockClientIds();

// Abort if there is selection, but it is not within a block.
if (
selectionRoot &&
! selectionRoot.closest(
`[data-block="${ selectedClientIds[ 0 ] }"]`
) &&
selectedClientIds.length < 2
) {
if ( selectionRoot && ! selectedClientIds.length ) {
return;
}

Expand Down

0 comments on commit 8579290

Please sign in to comment.