Closed Bug 1892848 Opened 10 months ago Closed 10 months ago

Improve SelectTranslationsPanel translate via keyboard navigation

Categories

(Firefox :: Translations, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: nordzilla, Assigned: nordzilla)

References

Details

Attachments

(3 files, 1 obsolete file)

Description

When initially talking to the a11y team about how translate should work when selecting a dropdown menu directly via keyboard, they said it would make sense to translate when the menulist gets a blur event.

This is the overall right idea, but it makes it awkward if you've just changed the from-language and then you tab over to change the to-language. The fromMenuList receives its blur event, and then it starts translating.

A better heuristic would be if the textarea receives focus after a direct keyboard language change. This way the user can Tab or Shift + Tab between the two language menu lists and a translation won't trigger until they Tab onto the textarea where they expect the translation to occur.


Steps to implement

  • Remove the translate on blur event from the menu list on direct language change.
  • Add a translate on focus event to the textarea on direct language change.

Tests to implement

  • Ensure that the test cases cover both conditions of pressing Enter to translate, or focusing the textarea element.
Attachment #9398033 - Attachment description: WIP: Bug 1892848 - WIP → WIP: Bug 1892848 - Refactor SelectTranslationsPanel translation event listeners

Reworks the SelectTranslationsPanel translate on keyboard
navigation events to translate when the textarea is focused
after a langauge change, instead of on when the menu list
is blurred.

Attachment #9398033 - Attachment description: WIP: Bug 1892848 - Refactor SelectTranslationsPanel translation event listeners → Bug 1892848 - Refactor SelectTranslationsPanel translation event listeners r=#translations-reviewers!
Attachment #9398045 - Attachment description: WIP: Bug 1892848 - Rework translate on keyboard navigation → Bug 1892848 - Rework translate on keyboard navigation r=#translations-reviewers!
Attachment #9398266 - Attachment description: WIP: Bug 1892848 - WIP → Bug 1892848 - Init translate event listeners on open r=#translations-reviewers!

Ensures that the focus shifts back to the last-interacted
menu list if the translation fails, so that users utilizing
keyboard navigation can pick up where they left off.

Attachment #9398272 - Attachment is obsolete: true
Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/80b35b690e46 Refactor SelectTranslationsPanel translation event listeners r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/cd9227638299 Rework translate on keyboard navigation r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/0273961a00f1 Init translate event listeners on open r=translations-reviewers,gregtatum
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: