Closed ilhan007 closed 3 years ago
Hello @SAP/ui5-webcomponents-topic-b
this request for refactoring origins from the following SegmentedButton a11y issue: #2934
After discussing it with @ghristanov and within the Web Components team, we decided to go for implementing a new child component, SegmentedButtonItem, in order to full-fill the a11y spec. You can find more details above.
As the refactoring will lead to API BREAKING CHANGES, please consider this is HIGH PRIORITY task.
Best, ilhan
@ilhan007 is it possible to release this change to one SF patch version? Thanks
Hello @BennyHuang we can, but as it's a breaking change, could you post a message in the SFSF channel to let everyone know and make sure that everyone is fine with downporting it.
Is your feature request related to a problem? Please describe. To full-fill the accessibility spec of the SegmentedButton, we would need to perform a significant DOM refactoring. The ToggleButton component can't be used as a child of the SegmentedButton as certain aria attributes requires different DOM elements. And, we can't change the ToggleButton for the purpose of the SegmentedButton.
That's why we will need a new dedicated component - SegmentedButtonItem, that would like look and act the same as the ToggleButton, but will be rendered with different DOM elements and aria attributes.
Stakeholder SuccessFactors
Origin issue https://github.com/SAP/ui5-webcomponents/issues/2934
Reference https://openui5nightly.hana.ondemand.com/entity/sap.m.SegmentedButton/sample/sap.m.sample.SegmentedButton
Contact Person on accessibility questions @ghristanov
Usage
Note The tag name can be discussed, this is an example, if you come up with better suggestion, please raise it.
Another solution Considered We also considered leaving the ToggleButton as it is now, and internally wrap the toggle buttons with new elements and provide the required aria attrs on that elements, but then we would also have to bring the focus to these new elements and the toggle buttons start looking obsolete and the DOM too complex. That's why we want to stick to the aforementioned solution