Closed Bug 1660951 Opened 4 years ago Closed 4 years ago

TabDialogBox doesn't restore focus when returning from another tab

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

VERIFIED FIXED
82 Branch
Accessibility Severity s3
Tracking Status
firefox81 --- verified
firefox82 --- verified

People

(Reporter: Jamie, Assigned: pbz)

References

Details

(Keywords: access)

Attachments

(1 file)

STR:

  1. Open two tabs.
  2. In the second tab, open any web page.
  3. Open the new print modal.
  4. Press control+1 to switch to the first tab.
  5. Press control+2 to switch back to the second tab (the one with the print modal open).
    • Expected: Focus should go to the printer picker.
    • Actual: Focus goes to limbo (the top level browser window).

This applies to any TabDialogBox. For example, you see the same bug if you do this in the browser console instead of opening the print modal:
Services.prompt.alertBC(gBrowser.selectedBrowser.browsingContext, Ci.nsIPrompt.MODAL_TYPE_TAB, "Hi", "Hi")

I think this would need the block at https://searchfox.org/mozilla-central/rev/19c23d725f27d0989e4a60f36d64004cebb39736/browser/base/content/tabbrowser.js#1287-1298 expanding to also cover TabDialogBox. Paul, is this something you can take on?

Flags: needinfo?(pbz)
Component: Notifications and Alerts → Tabbed Browser
Product: Toolkit → Firefox

(In reply to :Gijs (he/him) from comment #1)

I think this would need the block at https://searchfox.org/mozilla-central/rev/19c23d725f27d0989e4a60f36d64004cebb39736/browser/base/content/tabbrowser.js#1287-1298 expanding to also cover TabDialogBox. Paul, is this something you can take on?

Thanks! Yes that sounds like a good idea. Perhaps we could extend TabDialogBox with a focus method so the caller doesn't have to know what's on top.

Assignee: nobody → pbz
Status: NEW → ASSIGNED
Flags: needinfo?(pbz)
Pushed by pzuhlcke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d0b7071a6946
Focus TabDialogBox top dialog when switching tabs. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Comment on attachment 9172424 [details]
Bug 1660951 - Focus TabDialogBox top dialog when switching tabs. r=gijs!

Beta/Release Uplift Approval Request

  • User impact if declined: Accessibility: It's difficult for users to interact with or close the print dialog by keyboard after switching tabs.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): Small patch. Medium risk because it could potentially break the tab switch focus behavior including restoring URL bar focus.
  • String changes made/needed:
Attachment #9172424 - Flags: approval-mozilla-beta?

Comment on attachment 9172424 [details]
Bug 1660951 - Focus TabDialogBox top dialog when switching tabs. r=gijs!

Approved for 81.0b5.

Attachment #9172424 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Confirming this issue as verified fixed on macOS 10.15, Ubuntu 18.04 and Windows 10x64. Verified using 82.0a1 (2020-09-09) and 81.0b8.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
See Also: → 1686957
Accessibility Severity: --- → s3
Whiteboard: [access-s3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: