Skip to content

Commit 3c62f98

Browse files
committed
fix(picker-column): add ariaHidden based on platform
1 parent 3583fcd commit 3c62f98

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

core/src/components/picker-column/picker-column.tsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ export class PickerColumn implements ComponentInterface {
669669
render() {
670670
const { color, disabled, isActive, numericInput } = this;
671671
const mode = getIonMode(this);
672+
const mobile = isPlatform('mobile');
672673

673674
return (
674675
<Host
@@ -682,7 +683,32 @@ export class PickerColumn implements ComponentInterface {
682683
{this.renderAssistiveFocusable()}
683684
<slot name="prefix"></slot>
684685
<div
685-
aria-hidden="true"
686+
/**
687+
* This element is hidden from mobile screen readers.
688+
* This prevents the element from being incorrectly
689+
* focused and announced, which can happen on mobile
690+
* devices due to its overflow styles. Hiding it ensures
691+
* it is excluded from the accessibility tree and does
692+
* not interfere with screen reader navigation.
693+
* However, the options are still clickable on web apps.
694+
*
695+
*/
696+
697+
/**
698+
* his element is hidden from mobile screen readers.
699+
* This prevents the element from being incorrectly
700+
* focused and announced, which can happen on mobile
701+
* devices due to its overflow styles. Hiding it ensures
702+
* it is excluded from the accessibility tree.
703+
*
704+
* In web apps, users can click on the options inside
705+
* this element, so applying `aria-hidden="true"` can
706+
* lead to a blocked `aria-hidden` error.
707+
* To prevent this issue, `aria-hidden` is only added
708+
* on mobile devices where options cannot be tapped.
709+
*/
710+
711+
aria-hidden={mobile ? 'true' : undefined}
686712
class="picker-opts"
687713
ref={(el) => {
688714
this.scrollEl = el;

0 commit comments

Comments
 (0)