F6Navigation not properly implemented
What is the issue and how can we reproduce it?
- Open the sample
- Click on contend div to focus
- Press F6 twice to navigate
- --> Issue: The focus lost
Thanks to @nnaydenow for build a reproducible demo and pinpointing the root cause:
It looks like there's an issue with the F6 navigation implementation in OpenUI5 when multiple shadow roots are involved.
I've created a minimal reproducible example using native web components and OpenUI5: https://jsbin.com/nerapuhitu/1/edit?html,output
The problem occurs with custom elements that have a tabindex but no focusable content inside their shadow root. Here's a simplified example: https://jsbin.com/sifozupevi/edit?html,output
- parent web component - child web component with tabindex - #shadow root - span elementWhen the span inside the shadow root is clicked, the child web component receives focus, but it doesn't contain any actual focusable elements inside its shadow root.
The logic in the following line is assumes that the active element is always within the shadow DOM of the web component, rather than accounting for cases where the web component itself is focused: https://github.com/UI5/openui5/blob/master/src/sap.ui.core/src/sap/ui/events/F6Navigation.js#L63
Which OpenUI5 version is your project targeting?
1.138
Is the issue device- or browser-specific?
No response
Confirmation
- [x] I have searched the existing issues and reviewed the relevant documentation as well as the API reference.
- [x] I am not disclosing any internal or sensitive information.
Hello colleagues,
The issue is easily reproducible in the following example: 🔗 https://jsbin.com/sifozupevi/edit?html,output
Steps to reproduce: Click the "Click me" element. Press F6.
You will see the error appear in the console.
Hello @quinn-zhang-sap , Thank you for sharing this finding. I've created an internal incident DINC0601884. The status of the issue will be updated here in GitHub.
Best Regards, Stefan
Hi @quinn-zhang-sap,
the issue is now fixed with commit a9096647497e929083f0564bc706dd02cf4efec0.
The fix will be available from version 1.141. Do you need the fix to be downported to any released code lines?
Best regards, Jiawei