sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Can't focus on normally focusable elements when pressing the tab key on the keyboard

Open tdwhite0 opened this issue 1 year ago • 10 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • [ ] 💥 Internet Explorer
  • [X] 💥 Microsoft Edge
  • [X] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [ ] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [ ] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

latest Chrome and Edge

Describe the bug / error

Elements added to a SharePoint page that are inside Shadow Roots are unable to be focused on with the tab key. Tabbing through the page will completely skip over these elements. I have created a simple reproduction showing the most simple case. Our real world usage is using Stencil Web Components, which all have this issue when using Shadow DOM.

Steps to reproduce

  1. Create a basic WebPart and use Shadow Root to add normally focusable inputs and buttons like in this reproduction I have made here: https://github.com/tdwhite0/sp-shadowdomissue-repro
  2. Observe that the tab key skips over them when going through the page.
image

Expected behavior

Elements should be focusable with the tab key.

From digging through what SharePoint is doing, I can see that there is an Accessibility manager component that tries to determine the next focusable element. This code does not take into account elements that are in Shadow Roots.

tdwhite0 avatar Jun 09 '23 15:06 tdwhite0

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jun 09 '23 15:06 ghost

Any updates on this issue? I have a couple customers that this is impacting and accessibility should be a priority from an issue standpoint.

marnocha avatar Jun 26 '23 14:06 marnocha

This is also impacting customers using Microsoft Graph Toolkit. We have a report from a customer on our repo that we have verified and tested as only being an issue when used in the context of webparts in a SharePoint page https://github.com/microsoftgraph/microsoft-graph-toolkit/issues/1909

gavinbarron avatar Jul 13 '23 14:07 gavinbarron

For more information, if you search the SharePoint OOB javascript for "_queryFocusableSelector" you can find the method that searches the DOM for focusable elements.

image

This querySelector does not return elements in Shadow DOM so therefore elements inside will never be returned.

tdwhite0 avatar Aug 09 '23 16:08 tdwhite0

@AJIXuMuK - Any updates on this issue?

marnocha avatar Oct 13 '23 16:10 marnocha

@VesaJuvonen @AJIXuMuK - What is the progress of this issue being addressed? Any status updates at all would be appreciated.

USCloud-EricWilborn avatar Oct 23 '23 15:10 USCloud-EricWilborn

@USCloud-EricWilborn - we have this issue in the internal backlog of the responsible team. Unfortunately, there is no ETA.

AJIXuMuK avatar Oct 24 '23 10:10 AJIXuMuK

@VesaJuvonen @AJIXuMuK any further updates on this?

marnocha avatar Dec 01 '23 16:12 marnocha

@VesaJuvonen @AJIXuMuK any further updates on this?

marnocha avatar Jan 17 '24 18:01 marnocha

Maybe Q2 2024, perhaps later for a fix.

tumbleweed05 avatar Feb 21 '24 22:02 tumbleweed05