Closed Bug 1661857 Opened 5 years ago Closed 3 years ago

Selecting spelling correction with Enter key passes key to input element in form

Categories

(Toolkit :: UI Widgets, defect)

79 Branch
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: asoroudi, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

  1. Go to an Stack Exchange site
  2. Click on an "add a comment" link to open a comment-submission box
  3. Type some text, making sure to misspell a word
  4. Put the caret on the misspelled word and press the Apps/Context key
  5. Use the arrow keys to highlight the correct spelling
  6. Press Enter to select the correct spelling

Actual results:

The misspelled word is corrected and the comment is submitted.

Expected results:

The misspelled word should be corrected, but the comment box should remain open; it should not get submitted.

When you press Enter to select the correct spelling, the browser does not eat the Enter key and incorrectly passes it to the page.

(I couldn't check it because Escape doesn't close the comment box on Stack Exchange, but I suspect the same goes for pressing the Escape key, it would likely get passed to the page and cancel the box on sites that use Escape to close it.)

Hi Synetech,

I am trying to replicate this issue on my end. I'm using windows 10 pro, can you provide an example? Does reddit work to reproduce this issue?

I tried https://stackexchange.com/ this page but when clicking "add a comment" button, I'm shown "You must have 5 reputation to comment" as I just created the account to test this.

Also, are you reproducing this in desktop or mobile device? Does Chrome have a different behaviour?

I will move this over to a component so developers can take a look over it.

Thanks for the report.

Best regards, Clara.

Component: Untriaged → Spelling checker
Flags: needinfo?(asoroudi)
Product: Firefox → Core

• It's a desktop.
• I stopped using Chrome a few years ago, but I just checked it and it works fine in Chrome. If I make a typo in the comment box, open the spelling menu, and select the correction with the Enter key, it replaces the misspelled word and leaves the comment box open and active for typing, it doesn't send the Enter key to the page to submit the (incomplete) comment.
• The problem occurs on all StackExchange sites (StackOverflow, SuperUser, Gaming, etc.) and likely any site that uses Enter to submit a form (i.e., all of them).
• It doesn't happen on Reddit because the comment boxes are multi-line, so the Enter key doesn't submit the comment, it just creates a new line.

Flags: needinfo?(asoroudi)

Thanks for the additional details. Unfortunately I'm not able to try replicate this on my end since all those sites won't allow me add a comment as a new user

Please test if the issue occurs to you in safe mode (add-ons disabled). Here is a link that can help you do that:
https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode

If the issue persists, also test it using a fresh profile, you can find the steps to do that below:
https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles?redirectlocale=en-US&redirectslug=Managing-profiles#w_starting-the-profile-manager

Also, can you try this on the latest version of nightly? You can download it from here: https://nightly.mozilla.org/

If Core: Spelling checker is not the right component, please address it to a more suitable one.

Best regards,
Clara

Flags: needinfo?(asoroudi)

I just downloaded the latest nightly, extracted it, ran it with a fresh dummy profile, logged into Google and went to SuperUser.com. I typed a comment with a typo, pressed the apps/menu key to bring up the context-menu and selected the correct spelling and pressed Enter. Firefox replaced the misspelled word with the correct one and submitted the (incomplete) comment. Firefox passed the Enter key used to dismiss the content-menu to the page instead of eating it. (This doesn't happen if using the mouse to select the word from the menu, but you can't rely on that; it's not accessible for all users all the time, the keyboard should work correctly.)

Flags: needinfo?(asoroudi)

Thanks for the additional information. I've already set the component for the dev team to get involved. In case they need further instructions they will let you know.
Thanks!
Clara

This seems to be more generic issue with contextmenus, not about spellchecking.

Component: Spelling checker → XUL Widgets
Product: Core → Toolkit

The severity field is not set for this bug.
:mstriemer, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(mstriemer)
Flags: needinfo?(mstriemer) → needinfo?(enndeakin)

When I create a simple form, a try to replicate the steps with that, I cannot. The enter key does not get sent to the page or the form at all.

Flags: needinfo?(enndeakin)

I also can't reproduce this. If you have a publicly available case where this can be reproduced we can investigate more.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME

Did you try it in the comments element in any StackExchange site (per the original bug-report)?

You need to log in before you can comment on or make changes to this bug.