Skip to content

Commit

Permalink
Merge pull request #52 from Automattic/fix/blur-inside-popover
Browse files Browse the repository at this point in the history
Fix blur clicks when they go to the root popover
  • Loading branch information
johngodley committed Sep 9, 2021
2 parents c09efcd + 173f207 commit 5064b81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.4.1] - 2021-09-09

### Fixed

- Further fix to blur event in block inspector to catch clicks that fall in the popover itself

## [2.4.0] - 2021-09-08

### Breaking changes
Expand Down
5 changes: 4 additions & 1 deletion src/components/block-editor-container/click-outside.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ const ClickOutsideWrapper = withFocusOutside(

// Clicks in the media modal or popup components are considered in the editor
isInspectorElement( element ) {
// Inside a colour picker popover
if ( element.closest( '.components-color-picker' ) ) {
return true;
}

if ( element.closest( '.block-editor-block-inspector' ) ) {
// Inside the inspector
if ( element.closest( '.block-editor-block-inspector' ) || element.closest( '.iso-inspector' ) ) {
return true;
}

// In the media modal
if ( element.classList.contains( 'media-modal' ) ) {
return true;
}
Expand Down

0 comments on commit 5064b81

Please sign in to comment.