WordPress.org

Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #38091


Ignore:
Timestamp:
09/19/2016 05:18:24 AM (4 years ago)
Author:
westonruter
Comment:

In 38091.0.diff:

  • On keydown events for ESC that reach the body, abort if the target element not the body and is not inside of #customize-controls. Such events are being triggered on modals and other such elements that are not inside of the customizer controls and so they should not cause the current control/section/panel to collapse.
  • Let ThemesSection listen for keydown instead of keyup, and let it listen to events on the section container instead of the body. Ensure that the keydown event for ESC has its propagation stopped so that the themes section is not then collapsed.
  • Improve color picker by adding support to close the picker when the ESC key is pressed. When closing the picker, the focus is then added to the link that opens the picker. When ESC is pressed again, then the section is collapsed.

This is a defect in a new feature added in 4.6 so it could be part of 4.6.2

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #38091

    • Property Owner set to westonruter
    • Property Status changed from new to accepted
    • Property Keywords has-patch added
  • Ticket #38091 – Description

    initial v2  
    1 In #22237 a keyboard shortcut ESC was added to collapse the currently-expanded control, section, or panel. This feature turns out to exhibit some unexpected behaviors when attempting to use the ESC key to collapse the color picker: it causes the entire section to collapse, not just the color picker. Also, if there are any custom modal dialogs or other elements (like TinyMCE toolbars) that don't trap the ESC `keydown` event, hitting ESC will not only cause the modal/toolbar to close but also collapse the current control or section.
     1In #22237 a keyboard shortcut ESC was added to collapse the currently-expanded control, section, or panel. This feature turns out to exhibit some unexpected behaviors when attempting to use the ESC key to collapse the a `ThemesSection` modal, where closing the modal with ESC also causes the themes section to collapse unexpectedly, before then re-expanding to focus on the theme control.
     2
     3Also for the color picker, I expected that hitting ESC would close the color picker, but instead it causes the entire section to collapse, not just the color picker.
     4
     5Lastly, if there are any custom modal dialogs or other elements (like TinyMCE toolbars) that don't trap the ESC `keydown` event, hitting ESC will not only cause the modal/toolbar to close but also collapse the current control or section.