Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SF][Bar]: Role provided to bar is not cascaded to the DOM and instead take toolbar as default #10990

Open
1 task done
Natesan opened this issue Mar 3, 2025 · 3 comments · May be fixed by #11134
Open
1 task done

Comments

@Natesan
Copy link

Natesan commented Mar 3, 2025

Describe the bug

Role provided to the Bar component is not percolated to the DOM and always retains the default role as toolbar which is not a suitable role when a Bar holds no interactive element (but just a title for example).

Isolated Example

https://sap.github.io/ui5-webcomponents-react/v2/?path=/docs/layouts-floorplans-bar--docs
https://stackblitz.com/edit/react-gnayqu4c?file=src%2FApp.js

Image

Reproduction steps

  1. Navigate to https://sap.github.io/ui5-webcomponents-react/v2/?path=/docs/layouts-floorplans-bar--docs
  2. Open the developer tools and inspect the shadow DOM of the bar
  3. Observe that it always retains the role as toolbar

Expected Behaviour

Role passed to the component should be retained on the DOM for accessibility reasons. We use a Bar component for the dialog header with the design parameter set to Header. Looking at the documentation at https://sap.github.io/ui5-webcomponents-react/v2/?path=/docs/layouts-floorplans-bar--docs&globals=theme:sap_horizon_dark I get to find that the default role provided to the internal Bar implementation is a 'toolbar'. We need to add a title to the Dialog which generally starts from the left of the dialog header region. Generally a Bar is used to hold titles, buttons and input elements on the page header and footer but in this case we do not have an interactive element on the dialog header and hence setting the role to toolbar by default is not the expected behaviour

Screenshots or Videos

Image

Even when the role is provided to the Bar it doesn't drill it down the DOM

UI5 Web Components for React Version

2.7.0

UI5 Web Components Version

2.7.0

Browser

Chrome

Operating System

MacOS

Additional Context

No response

Relevant log output

Organization

SF

Declaration

  • I’m not disclosing any internal or sensitive information.
@Lukas742
Copy link
Collaborator

Lukas742 commented Mar 3, 2025

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.

@Lukas742 Lukas742 transferred this issue from SAP/ui5-webcomponents-react Mar 3, 2025
@Natesan
Copy link
Author

Natesan commented Mar 3, 2025

Updated the description with a standalone example where the role provided to the Bar is not cascaded and instead the DOM containing the role toolbar which is allowing assistive technologies to read it as a toolbar (but in this case there is no interactive element present)

@Todor-ads
Copy link
Member

Hello @SAP/ui5-webcomponents-topic-b ,
could you please check this issue?
The issue reproduces following the described steps.

Thanks,
Todor

@Todor-ads Todor-ads removed their assignment Mar 7, 2025
@tsanislavgatev tsanislavgatev self-assigned this Mar 10, 2025
@tsanislavgatev tsanislavgatev moved this from New Issues to In Progress in Maintenance - Topic B Mar 18, 2025
@tsanislavgatev tsanislavgatev linked a pull request Mar 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Status: 🆕 New
Development

Successfully merging a pull request may close this issue.

4 participants