Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#54030 closed defect (bug) (fixed)

Pressing esc in Widgets Editor closes panel in customizer

Reported by: gwwar's profile gwwar Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.8.1 Priority: normal
Severity: normal Version: 5.8
Component: Customize Keywords: has-patch fixed-major
Focuses: Cc:

Description

When editing a widget in /wp-admin/customize.php?return=%2Fwp-admin%2Fwidgets.php using the widget block editor, try pressing "esc". The customizer panel is closed regardless of if the block editor has focus or not.

Attachments (1)

esc before.mp4 (114.3 KB) - added by gwwar 3 years ago.

Download all attachments as: .zip

Change History (10)

@gwwar
3 years ago

This ticket was mentioned in PR #1630 on WordPress/wordpress-develop by gwwar.


3 years ago
#1

  • Keywords has-patch added

Fixes https://core.trac.wordpress.org/ticket/54030

When editing a widget in /wp-admin/customize.php?return=%2Fwp-admin%2Fwidgets.php using the widget block editor, try pressing "esc". The customizer panel is closed regardless of if the block editor has focus or not.

Instead of having the block editor stop propagation of key events, let's make the customizer aware of block editor instances and avoid firing keyboard shortcuts if an editor instance has focus.

#### Before

https://user-images.githubusercontent.com/1270189/131191958-30bd5984-d5ba-4b61-a67d-a02534f3026a.mp4

#### After

https://user-images.githubusercontent.com/1270189/131191962-cd5f54c1-04fe-4867-b810-c94e223733d6.mp4

### Testing Instructions

  • Checkout this branch
  • Activate the 2020 theme and enable the Gutenberg plugin
  • Visit /wp-admin/customize.php?return=%2Fwp-admin%2Fwidgets.php
  • Add a widget, and a block like a paragraph
  • Press <kbd>esc</kbd>
  • Verify that the block editor goes into navigator mode and that the customizer panel does not close

#2 @dlh
3 years ago

  • Milestone changed from Awaiting Review to 5.9
  • Version changed from trunk to 5.8

Thanks for the ticket and patch, @gwwar!

Both the Additional CSS code editor and the pre-block, TinyMCE-powered Text widget seem to also intercept the Escape key as described in the PR. So, while I don't have the background to comment on the specifics of the Pull Request, conceptually the idea makes sense to me at first glance.

#3 @dlh
3 years ago

I suppose this could also be eligible for 5.8.1 if there was interest in picking it up sooner.

#4 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 51682:

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.
Fixes #54030.

#5 @SergeyBiryukov
3 years ago

  • Keywords fixed-major added
  • Milestone changed from 5.9 to 5.8.1
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 5.8.1 consideration.

#6 @SergeyBiryukov
3 years ago

In 51683:

Coding Standards: Fix WPCS issue in [51682].

This fixes a "Misleading line break before '||'; readers may interpret this as an expression boundary" error.

See #54030.

#7 @peterwilsoncc
3 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51687:

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.

#8 @gwwar
3 years ago

So speedy! Thanks y'all ✨

gwwar commented on PR #1630:


3 years ago
#9

closing since the patch landed ✅

Note: See TracTickets for help on using tickets.