Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#62346 accepted defect (bug)

"Close comment reply form on Escape" feature causes accidental sabotage

Reported by: yellowafterlife's profile yellowafterlife Owned by: joedolson's profile joedolson
Milestone: 6.8 Priority: normal
Severity: normal Version: 6.6.2
Component: Comments Keywords: has-patch
Focuses: ui, accessibility, javascript, administration Cc:

Description

This is kind of like #54548, but in a different scenario.

Here's a thing that happens every now and then:

  • I write an in-depth reply to a comment.
  • I decide to double-check spelling, so I press Menu to open the context menu.
  • "Check Spelling" turns out to be already on, so I press Escape to dismiss the context menu.
  • This snippet catches the "keyup" event, closing the comment reply form and dismissing everything that I just typed.
  • I let out a disappointed sigh and write a much shorter reply.

But there's more! This only happens in Firefox - in Chromium-based browsers the keyup event doesn't seem to be triggered at all (?)

Change History (5)

#1 @sabernhardt
5 weeks ago

  • Component changed from General to Comments

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


4 weeks ago

#3 @joedolson
4 weeks ago

  • Milestone changed from Awaiting Review to 6.8
  • Owner set to joedolson
  • Status changed from new to accepted

Thanks for reporting this! That's certainly irritating. I attempted to reproduce this following your instructions, but wasn't able to right away; however, I'm going to milestone this for 6.8 for further exploration to try and resolve it.

#4 @yogeshbhutkar
4 weeks ago

I was able to reproduce the bug spotted by @yellowafterlife. I confirm that this occurs only in Safari and Firefox; as pointed out by the author, it works as expected in Chromium-based Web Browsers.

Here are the simplified steps to replicate the same.

  1. Open a Web Browser and navigate to the Comments Menu.
  2. Click on reply on any comment.
  3. Type something and right-click within the comment box to open the context menu.
  4. Now hit escape.

On Chromium-based Web Browsers, just the context menu would close. However, on Safari and Firefox, the context menu and the comment box closes which also wipes off the earlier written comment.

This ticket was mentioned in PR #7786 on WordPress/wordpress-develop by @yogeshbhutkar.


4 weeks ago
#5

  • Keywords has-patch added

### Description
Previously, in Firefox and Safari, pressing the Escape key while the context menu was open (activated by right-clicking) inside the comments form in the comments menu of wp-admin would close both the context menu and the comment form. This resulted in the removal of the written comment, forcing the user to rewrite it.

### How was it fixed?
By using the contextmenu event, I was able to manage the state that controls the closing of the comment form when the context menu is open.

### Screencast of the fix:

https://github.com/user-attachments/assets/9b27cd45-3442-415c-8626-e334de715438

Trac ticket: https://core.trac.wordpress.org/ticket/62346

Note: See TracTickets for help on using tickets.