Opened 10 years ago
Last modified 3 years ago
#30979 accepted enhancement
Check for context menu before closing commentReply
Reported by: | jesin | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Comments | Keywords: | has-patch |
Focuses: | ui, administration | Cc: |
Description
Login to WP-Admin, go to the comments section and "Quick edit" or "Reply" to a comment.
Bring up the context menu either with a right-click or the menu key, press ESC and the context menu and the comment box will close.
I understand that this is the expected behaviour but this can be frustrating at times.
If you bring up the context menu while typing a long reply but decide not to autocorrect and press ESC to close the context menu everything you've typed so far is gone :(
The "Compose email" section of both Gmail and Outlook.com close themselves when ESC is pressed but don't if the context menu is open. So I thought WordPress should also have the same behaviour.
The patch checks for a right click or menu key press before doing commentReply.revert()
.
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #core by drew. View the logs.
10 years ago
#5
@
10 years ago
- Keywords commit added
30979.2.diff still applies, and it fixes the problem for me. Moving for commit consideration.
This ticket was mentioned in Slack in #core by drew. View the logs.
10 years ago
#7
@
10 years ago
- Keywords commit removed
- Milestone changed from 4.2 to Future Release
Punting this - esc key detection is used in multiple places, do we need to consider this on the bigger picture? A single fix can go in at once, but I'm uncomfortable doing that without at least taking a holistic look. Would also be nice to be clear on what browsers and OSes this affects - I get different results between Firefox and Chrome on OSX Yosemite.
#8
@
8 years ago
- Owner set to SergeyBiryukov
- Status changed from new to accepted
This was brought up in a recent post on support forums (in Russian).
The current behavior of silently closing the reply form when pressing Esc was introduced in [8720] and [9098]. The reply form was initially a popup, and this appears to be a remnant of the old UI.
There should be a warning of some kind when pressing Esc on a non-empty form, or a way to recover the entered text.
Refreshing the patch to use
on()
instead ofbind()
. Reason: as the jQuery documentation suggests,on()
is the recommended method and should be used instead ofbind()
. For more information: http://api.jquery.com/bind/#entry-longdesc