Closed Bug 1545932 Opened 1 year ago Closed 5 months ago

Opening a browserAction button should return focus to the previous location when closed

Categories

(Thunderbird :: Add-Ons: Extensions API, defect, P3)

defect

Tracking

(thunderbird_esr6870+ fixed, thunderbird70 fixed, thunderbird71 fixed)

RESOLVED FIXED
Thunderbird 71.0
Tracking Status
thunderbird_esr68 70+ fixed
thunderbird70 --- fixed
thunderbird71 --- fixed

People

(Reporter: Fallen, Assigned: Fallen)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR:

  • Create a WX add-on with a browser action and a keyboard shortcut for it
  • Navigate to message pane
  • Press keyboard shortcut (clicking also works), do things in the browser action that will finally close the popup window

Expected:

  • The focus returns to the message pane tree, arrow keys will allow moving to the next message

Actual:

  • The focus goes to the window object, not the tree it was previously at

This is essential for add-ons that aim to improve keyboard navigation and make actions for selected items, such as my quickmove extension. Here is a wx version of the add-on you can use for testing: https://github.com/kewisch/quickmove-extension/tree/webextension

I'm thinking about where to best implement this. My initial thought was saving document.activeElement when the popup is opened, and then returning to that when closed. Any thoughts darktrojan?

Flags: needinfo?(geoff)
Attached patch Fix - v1 β€” β€” Splinter Review
Assignee: nobody → philipp
Status: NEW → ASSIGNED
Attachment #9094863 - Flags: review?(geoff)
Flags: needinfo?(geoff)
Priority: -- → P3
Comment on attachment 9094863 [details] [diff] [review]
Fix - v1

Seems reasonable.
Attachment #9094863 - Flags: review?(geoff) → review+
Target Milestone: --- → Thunderbird 71.0

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/0f867b01c12b
Return focus to previous element when closing browser action. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Keywords: checkin-needed
Resolution: --- → FIXED
Comment on attachment 9094863 [details] [diff] [review]
Fix - v1

I'd like to see this in release if possible, it will help me get rid of hacks for an add-on I'm working on.
Attachment #9094863 - Flags: approval-comm-esr68?
Attachment #9094863 - Flags: approval-comm-beta?
Comment on attachment 9094863 [details] [diff] [review]
Fix - v1

Too bad we didn't include it in TB 70 beta 3 which shipped two days ago. I guess there's no harm done sticking it into the next available ESR release or would you like some beta exposure first. Seems like a small low-risk patch.
Attachment #9094863 - Flags: approval-comm-esr68?
Attachment #9094863 - Flags: approval-comm-esr68+
Attachment #9094863 - Flags: approval-comm-beta?
Attachment #9094863 - Flags: approval-comm-beta+

To me this seems low risk and I don't think it needs a beta cycle, I trust your judgement though.

TB 70 beta 4:
https://hg.mozilla.org/releases/comm-beta/rev/0e203dc1c0338a650d2fe3b2aed097cfadfdf7f7

We decided to do beta 4, so in it went. Will go into 68.2 after that.

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