Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-from-single-select] - Fixes screen reader issue #4002

Merged
merged 6 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/terra-form-select/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

* Fixed
* Fixed VoiceOver reading the selected item twice in `terra-form-single-select`.

## 6.53.0 - (January 2, 2024)

* Changed
Expand Down
9 changes: 2 additions & 7 deletions packages/terra-form-select/src/single/Frame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ class Frame extends React.Component {
aria-label={this.mainLabel()}
aria-haspopup={!disabled ? 'true' : undefined}
aria-describedby={ariaDescribedBy}
aria-owns={this.state.isOpen ? selectMenuId : undefined}
aria-required={required}
className={selectClasses}
onBlur={this.handleBlur}
Expand All @@ -526,15 +525,11 @@ class Frame extends React.Component {
<span id={descriptionId}>{this.renderDescriptionText()}</span>
</div>
{/* Added aria label to avoid announcing empty group by voice over in safari browser */}
<div className={cx('display')} aria-label={this.ariaLabel()} aria-hidden={disabled}>
<div className={cx('display')} aria-hidden={disabled}>
{this.getDisplay(displayId, placeholderId)}
</div>
{this.renderToggleButton()}
<span
aria-live={SharedUtil.isSafari() ? 'polite' : 'off'}
className={cx('visually-hidden-component')}
ref={this.visuallyHiddenComponent}
/>
{this.state.isOpen && <span aria-live={SharedUtil.isSafari() ? 'polite' : 'off'} className={cx('visually-hidden-component')} ref={this.visuallyHiddenComponent} />}
{this.state.isOpen && (
<Dropdown
{...dropdownAttrs}
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-select/src/single/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class Menu extends React.Component {
variant: 'default',
totalOptions: object.length,
index: object.indexOf(option) + 1,
expandedStateText: this.state.expandedStateText,
expandedStateText: !(navigator.userAgent.indexOf('Edg') !== -1) ? this.state.expandedStateText : '',
ofText: this.props.intl.formatMessage({ id: 'Terra.form.select.of' }),
onMouseDown: () => { this.downOption = option; },
onMouseUp: event => this.handleOptionClick(event, option),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ exports[`Frame correctly applies the theme context className for default variant
</div>
<div
aria-hidden="false"
aria-label=""
class="display"
>
<div
Expand All @@ -108,10 +107,6 @@ exports[`Frame correctly applies the theme context className for default variant
class="arrow-icon"
/>
</div>
<span
aria-live="off"
class="visually-hidden-component"
/>
</div>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ exports[`Select correctly applies the theme context className for default varian
</div>
<div
aria-hidden="false"
aria-label=""
class="display"
>
<div
Expand All @@ -53,10 +52,6 @@ exports[`Select correctly applies the theme context className for default varian
class="arrow-icon"
/>
</div>
<span
aria-live="off"
class="visually-hidden-component"
/>
</div>
`;

Expand Down Expand Up @@ -658,7 +653,6 @@ exports[`Select should render a select with an optgroup and an option 1`] = `
</div>
<div
aria-hidden="false"
aria-label=""
class="display"
>
<div
Expand All @@ -677,10 +671,6 @@ exports[`Select should render a select with an optgroup and an option 1`] = `
class="arrow-icon"
/>
</div>
<span
aria-live="off"
class="visually-hidden-component"
/>
</div>
`;

Expand Down Expand Up @@ -718,7 +708,6 @@ exports[`Select should render a select with an optgroup and multiple options 1`]
</div>
<div
aria-hidden="false"
aria-label=""
class="display"
>
<div
Expand All @@ -737,10 +726,6 @@ exports[`Select should render a select with an optgroup and multiple options 1`]
class="arrow-icon"
/>
</div>
<span
aria-live="off"
class="visually-hidden-component"
/>
</div>
`;

Expand Down Expand Up @@ -778,7 +763,6 @@ exports[`Select should render a select with an option 1`] = `
</div>
<div
aria-hidden="false"
aria-label=""
class="display"
>
<div
Expand All @@ -797,10 +781,6 @@ exports[`Select should render a select with an option 1`] = `
class="arrow-icon"
/>
</div>
<span
aria-live="off"
class="visually-hidden-component"
/>
</div>
`;

Expand Down Expand Up @@ -838,7 +818,6 @@ exports[`Select should render a select with multiple options 1`] = `
</div>
<div
aria-hidden="false"
aria-label=""
class="display"
>
<div
Expand All @@ -857,10 +836,6 @@ exports[`Select should render a select with multiple options 1`] = `
class="arrow-icon"
/>
</div>
<span
aria-live="off"
class="visually-hidden-component"
/>
</div>
`;

Expand Down
Loading