[wp-trac] [WordPress Trac] #26854: Don't close fullscreen mode on Esc when the media modal is shown

WordPress Trac noreply at wordpress.org
Sun Feb 25 16:35:06 UTC 2024


#26854: Don't close fullscreen mode on Esc when the media modal is shown
--------------------------+---------------------
 Reporter:  kovshenin     |       Owner:  azaozz
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  3.9
Component:  Editor        |     Version:  3.5
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by tetanoidrp):

 The problem was that when in fullscreen mode, pressing the Escape key
 closed both the media modal and the fullscreen mode, whereas only the
 media modal was expected to close.

 To reproduce the issue:

 Create a new post.
 Select Text mode and enable fullscreen mode.
 Hit the Add Media button.
 Hit the Escape key on your keyboard.
 The unexpected behavior was that both the media modal and fullscreen mode
 would close, while only the media modal should have closed.

 The fix involved consolidating the "close on Escape" behavior across
 various components such as the media modal, distraction-free writing mode
 (DFW), wpLink, and Thickbox. This consolidation was aimed at ensuring
 consistent behavior across these components when handling the Escape key.

 The technical details of the fix involved stopping event propagation on
 media modal close with the Escape key, as well as using the keydown event
 to close fullscreen instead of keyup, to ensure the correct firing order
 of event handlers.

 In summary, the issue was addressed by ensuring that pressing the Escape
 key only closed the media modal when it was expected to, without affecting
 other components like fullscreen mode.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/26854#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list