Page MenuHomePhabricator

It's possible to tab from the location bar to elements in the document behind any OOUI modal dialog
Closed, ResolvedPublic0 Estimated Story PointsBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Open any dialog window in VE, e.g. the interface of Kartographer, or insert a template.
  • Click into the browser's address bar.
  • Use the tab key to access all elements.

What happens?:
Everything in the page behind the interface behind the popup is in the tab order, when tabbing out from the location bar. If the user clicks into the dialog before tabbing, this is not the case and focus is constrained to dialog elements.

Screenshot from 2022-05-04 14-57-15.png (1×1 px, 139 KB)

We dug a bit into the code and found something called "focusTrap" in the OOUI Window class. This is responsible for trapping the focus within a window, as long as the focus starts in the dialog. When starting from e.g. the browser's address bar it doesn't work.

What should have happened instead?:
Only the the keyboard-interactable elements of the dialog should be in the tab order.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
Firefox 78 and 100

Event Timeline

Lena_WMDE renamed this task from Don’t include elements outside of the dialog in the tab order to Don’t include elements outside of the VE maps dialog in the tab order.May 10 2022, 11:58 AM

For what it's worth, focus is contained to the dialog when it's open -- tabbing past the end of the elements in the dialog will send you back to the first element in the dialog, and vice versa. (I'll grant that I don't know to what extent accessibility tools could be used to bypass this. But regular keyboard navigation can't escape.)

Yeah, not sure what tool was used here, but OOUI dialogs do active focus trapping and set aria-hidden to areas outside the dialog. Until inert arrives, I don't think you can do much better than that.

awight renamed this task from Don’t include elements outside of the VE maps dialog in the tab order to VE Maps dialog should only allow tab-focus into interactive elements.May 12 2022, 10:20 AM
awight updated the task description. (Show Details)
awight added subscribers: ECohen_WMDE, awight.

@ECohen_WMDE I believe I'm seeing the same effect that you were, but I have a slightly different explanation. I've updated the task description to reflect this.

awight renamed this task from VE Maps dialog should only allow tab-focus into interactive elements to VE Maps dialog should only allow tab-focus into keyboard-interactive elements.May 12 2022, 10:32 AM
awight updated the task description. (Show Details)

@ECohen_WMDE I believe I'm seeing the same effect that you were, but I have a slightly different explanation. I've updated the task description to reflect this.

Update: I was able to reproduce the original bug by starting tabbing from the location bar.

thiemowmde renamed this task from VE Maps dialog should only allow tab-focus into keyboard-interactive elements to It's possible to tab to elements in the document behind any VisualEditor dialog.May 13 2022, 1:26 PM
thiemowmde updated the task description. (Show Details)
thiemowmde set the point value for this task to 2.May 13 2022, 1:29 PM
thiemowmde subscribed.

We learned this is not WMDE-GeoInfo-FocusArea specific, but a generic issue in VisualEditor, maybe in OOUI. We want to spend a few minutes to see if we can identify something, but would like to hand this over to the Editing-team then.

DLynch renamed this task from It's possible to tab to elements in the document behind any VisualEditor dialog to It's possible to tab from the location bar to elements in the document behind any VisualEditor dialog.May 13 2022, 7:36 PM
thiemowmde updated the task description. (Show Details)
thiemowmde added a project: Editing-team.

We learned this is a very generic OOUI issue and would like to hand this over to the Editing-team.

Initial impressions are that we might need to listen to the document focus event, to catch the first focus event when tabbing into the page from the location bar. The handler would simply re-focus into the modal dialog.

That sounds right to me. You'd probably want to add this in OO.ui.WindowManager.prototype.toggleAriaIsolation.

Change 792673 had a related patch set uploaded (by Esanders; author: Esanders):

[oojs/ui@master] WindowManager: Check focus doesn't end up outside modal windows when focusing the page

https://gerrit.wikimedia.org/r/792673

Esanders renamed this task from It's possible to tab from the location bar to elements in the document behind any VisualEditor dialog to It's possible to tab from the location bar to elements in the document behind any OOUI modal dialog.May 17 2022, 5:36 PM

Change 792679 had a related patch set uploaded (by Esanders; author: Esanders):

[oojs/ui@master] WindowManager: Set 'inert' as well as 'aria-hidden' when opening modals

https://gerrit.wikimedia.org/r/792679

Change 792673 merged by jenkins-bot:

[oojs/ui@master] WindowManager: Check focus doesn't end up outside modal windows when focusing the page

https://gerrit.wikimedia.org/r/792673

Change 792679 merged by jenkins-bot:

[oojs/ui@master] WindowManager: Set 'inert' as well as 'aria-hidden' when opening modals

https://gerrit.wikimedia.org/r/792679

awight changed the point value for this task from 2 to 0.Jul 6 2022, 8:39 AM

@matmarex Just nudging that we're still hoping for an OOUI release, for this task and for T299036.

@matmarex Just nudging that we're still hoping for an OOUI release, for this task and for T299036.

It's not up to me, I'm waiting for a release as well. @Jdforrester-WMF and @Volker_E usually do the releases.

I just push buttons; Design Systems Team are the product owner.

Change 813630 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] Update OOUI to v0.44.1

https://gerrit.wikimedia.org/r/813630

Change 813630 merged by jenkins-bot:

[mediawiki/core@master] Update OOUI to v0.44.1

https://gerrit.wikimedia.org/r/813630

EAkinloose subscribed.

✅Only the the keyboard-interactable elements of the dialog should be in the tab order. See https://photos.app.goo.gl/oFzANAeCAq9FNhdF7

thiemowmde claimed this task.