Closed Bug 1630765 Opened 5 years ago Closed 5 years ago

The focus ring jumps to the next addressing row after a pill is created.

Categories

(Thunderbird :: Message Compose Window, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 77.0

People

(Reporter: aleca, Assigned: aleca)

References

(Regression)

Details

(Keywords: regression, ux-efficiency)

Attachments

(1 file, 1 obsolete file)

Due to the changes done in bug 1627520, replacing onkeypress with onkeydown, out event handler for the addressing row doesn't properly work anymore, and the focus jumps on the next focusable field right after a pill has been created, which is super annoying when needing to write multiple recipients.

Keywords: regression
Attached patch compose-focus.diff (obsolete) (deleted) — Splinter Review

This does the trick, but I don't know if this is the proper approach to handle this issue.

Emilio, is there any event or attribute we could watch on the autocomplete-input to know when a keydown event is handled by the autocomplete?
I'm already observing the autocomplete-did-enter-text topic. Would something like that available in a simple onkeydown event?

Attachment #9141089 - Flags: review?(mkmelin+mozilla)

I forgot to NI,

Emilio, is there any event or attribute we could watch on the autocomplete-input to know when a keydown event is handled by the autocomplete?
I'm already observing the autocomplete-did-enter-text topic. Would something like that available in a simple onkeydown event?

Flags: needinfo?(emilio)
Comment on attachment 9141089 [details] [diff] [review] compose-focus.diff Review of attachment 9141089 [details] [diff] [review]: ----------------------------------------------------------------- Yeah, this looks like a massive hack. ::: mail/base/content/mailWidgets.js @@ +2211,5 @@ > }); > input.addEventListener("blur", () => { > resetAddressContainer(input); > }); > + input.addEventListener("keydown", event => { If you want to handle this before autocomplete, you probably want to use `.onBeforeHandleKeyDown`, see https://searchfox.org/comm-central/rev/d9cc983e281ba4bfbb34722bb1f080124caf6263/mozilla/browser/components/search/content/searchbar.js#672 for example. If you want to check _afterwards_ and see if autocomplete has handled the event itself, you can check event.defaultPrevented and return if so.
Flags: needinfo?(emilio)
Attached patch compose-focus.diff (deleted) — Splinter Review
Attachment #9141089 - Attachment is obsolete: true
Attachment #9141089 - Flags: review?(mkmelin+mozilla)
Attachment #9141840 - Flags: review?(mkmelin+mozilla)
Attachment #9141840 - Flags: feedback?(bugzilla2007)
Blocks: 1629364
Comment on attachment 9141840 [details] [diff] [review] compose-focus.diff Review of attachment 9141840 [details] [diff] [review]: ----------------------------------------------------------------- Looks good thx! r=mkmelin
Attachment #9141840 - Flags: review?(mkmelin+mozilla) → review+

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/4217f78f73fc
Use onkeydown for input-autocomplete and prevent focus moving to the next addressing row after pill creation. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 77.0
Attachment #9141840 - Flags: feedback?(bugzilla2007)
Regressions: 1633562
Regressions: 1633287
Severity: -- → S2
Component: Composition → Message Compose Window
Product: MailNews Core → Thunderbird
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: