Make WordPress Core

Changeset 51687


Ignore:
Timestamp:
08/30/2021 03:29:25 AM (4 years ago)
Author:
peterwilsoncc
Message:

Customize: Prevent collapsing expanded panel/section/control when Esc is pressed on a block editor instance.

This ensures that the current panel is not collapsed when hitting Esc with the focus on the widget block editor.

Follow-up to [37347], [39120].

Props gwwar, dlh, SergeyBiryukov.
Merges [51682,51683] to the 5.8 branch.
Fixes #54030.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/js/_enqueues/wp/customize/controls.js

    r50547 r51687  
    84538453            }
    84548454
     8455            // Abort if we're inside of a block editor instance.
     8456            if ( event.target.closest( '.block-editor-writing-flow' ) !== null ||
     8457                event.target.closest( '.block-editor-block-list__block-popover' ) !== null
     8458            ) {
     8459                return;
     8460            }
     8461
    84558462            // Check for expanded expandable controls (e.g. widgets and nav menus items), sections, and panels.
    84568463            api.control.each( function( control ) {
Note: See TracChangeset for help on using the changeset viewer.