Skip to content

Commit 6e30b87

Browse files
author
Michael Jordan
authored
fix(#4078): MobileComboBox: searchbox should not have aria-expanded property (#4079)
1 parent 5e5d3ce commit 6e30b87

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/@react-spectrum/combobox/src/MobileComboBox.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ function ComboBoxTray(props: ComboBoxTrayProps) {
331331
// VoiceOver on iOS reads "double tap to collapse" when focused on the input rather than
332332
// "double tap to edit text", as with a textbox or searchbox. We'd like double tapping to
333333
// open the virtual keyboard rather than closing the tray.
334+
// Unlike "combobox", "aria-expanded" is not a valid attribute on "searchbox".
334335
inputProps.role = 'searchbox';
335336
inputProps['aria-haspopup'] = 'listbox';
337+
delete inputProps['aria-expanded'];
336338
delete inputProps.onTouchEnd;
337339

338340
let clearButton = (

packages/@react-spectrum/combobox/test/ComboBox.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3621,7 +3621,7 @@ describe('ComboBox', function () {
36213621
expect(dialog).toHaveAttribute('aria-labelledby', input.getAttribute('aria-labelledby'));
36223622

36233623
expect(input).toHaveAttribute('role', 'searchbox');
3624-
expect(input).toHaveAttribute('aria-expanded', 'true');
3624+
expect(input).not.toHaveAttribute('aria-expanded');
36253625
expect(input).toHaveAttribute('aria-controls', listbox.id);
36263626
expect(input).toHaveAttribute('aria-haspopup', 'listbox');
36273627

0 commit comments

Comments
 (0)