Skip to content

Commit 56cc995

Browse files
authored
fix(ui5-date-picker): adjust value help icon role (#5419)
The ui5-date-picker value help icon is still decorative, but now has role "button". On desktop the value help icon should be hidden from the screen reader. For mobile devices the icon is visible for the screen readers, in order to enable explore by touch scenarios. Fixes: #5378
1 parent 514f632 commit 56cc995

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/main/src/DatePicker.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
name="{{openIconName}}"
3232
tabindex="-1"
3333
accessible-name="{{openIconTitle}}"
34+
accessible-role="button"
35+
aria-hidden="{{_ariaHidden}}"
3436
show-tooltip
3537
@click="{{togglePicker}}"
3638
input-icon

packages/main/src/DatePicker.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
isF4,
1717
isEnter,
1818
} from "@ui5/webcomponents-base/dist/Keys.js";
19-
import { isPhone } from "@ui5/webcomponents-base/dist/Device.js";
19+
import { isPhone, isDesktop } from "@ui5/webcomponents-base/dist/Device.js";
2020
import "@ui5/webcomponents-icons/dist/appointment-2.js";
2121
import "@ui5/webcomponents-icons/dist/decline.js";
2222
import HasPopup from "./types/HasPopup.js";
@@ -705,6 +705,14 @@ class DatePicker extends DateComponentBase {
705705
return false;
706706
}
707707

708+
/**
709+
* Defines whether the value help icon is hidden
710+
* @private
711+
*/
712+
get _ariaHidden() {
713+
return isDesktop();
714+
}
715+
708716
async _respPopover() {
709717
const staticAreaItem = await this.getStaticAreaItemDomRef();
710718
return staticAreaItem.querySelector("[ui5-responsive-popover]");

0 commit comments

Comments
 (0)