openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

F6Navigation not properly implemented

Open quinn-zhang-sap opened this issue 1 year ago • 3 comments

What is the issue and how can we reproduce it?

  1. Open the sample
  2. Click on contend div to focus
  3. Press F6 twice to navigate
  4. --> 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 element

When 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.

quinn-zhang-sap avatar Aug 04 '25 02:08 quinn-zhang-sap

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.

StefanDimitrov04 avatar Aug 08 '25 08:08 StefanDimitrov04

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

StefanDimitrov04 avatar Aug 08 '25 08:08 StefanDimitrov04

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

stopcoder avatar Aug 21 '25 01:08 stopcoder