Opened 11 years ago
Closed 11 years ago
#28279 closed defect (bug) (fixed)
DFW: escape key broken
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | |
Focuses: | accessibility | Cc: |
Description
Two things are broken:
- When the content is focussed (place your cursor in the content), pressing esc doesn't work. Adding a listener to the TinyMCE editor solves this.
- When switching tabs in the browser (or removing focus from the document some other way), pressing esc doesn't work because the document isn't focussed. Adding a listener to the window instead solves this.
You can't namespace events outside jQuery and keeping it in one place is useless, so I removed it.
Used keyup
rather than keydown
because that will only fire once.
Attachments (1)
Change History (11)
#3
@
11 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
#4
@
11 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This introduced a regression: when a modal is open (wpLink or media), Esc closes both the modal and DFW. Also, why remove the "namespace" from the jQuery event? This should probably go into the coding standards: all jQuery events *must* be namespaced. That adds another level of interoperability.
#5
follow-up:
↓ 6
@
11 years ago
This introduced a regression: when a modal is open (wpLink or media), Esc closes both the modal and DFW.
It looks like this also happens in 3.9. But let's fix it. :)
Also, why remove the "namespace" from the jQuery event? This should probably go into the coding standards: all jQuery events *must* be namespaced. That adds another level of interoperability.
Oh, sorry. So it doesn't matter that the other event can't be namespaced?
#6
in reply to:
↑ 5
@
11 years ago
Replying to avryl:
It looks like this also happens in 3.9. But let's fix it. :)
Seems to work well without that commit. At least for the wpLink and media modals.
So it doesn't matter that the other event can't be namespaced?
Well, TinyMCE is different. Doesn't mean we should treat jQuery the same :)
In this case it's most likely the event may need unbinding outside the editor to tweak closing modals.
#7
@
11 years ago
- Keywords needs-patch added; has-patch removed
Seems to work well without that commit. At least for the wpLink and media modals.
Weird, in 3.9 I enable DFW, open the media modal, press esc and everything closes.
In 28443: