Skip to content

Commit c547c31

Browse files
committed
fix(ui-utils,ui-select): make screenreader annouce disabled Select as dimmed in Chrome
INSTUI-4485
1 parent a473127 commit c547c31

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/ui-select/src/Select/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,11 +710,17 @@ class Select extends Component<SelectProps> {
710710
// Also on iOS Chrome with role='combobox' it announces unnecessarily
711711
// that its 'read-only' and that this is a 'textfield', see INSTUI-4500
712712
role:
713-
utils.isSafari() || utils.isAndroidOrIOS() ? 'button' : 'combobox',
713+
utils.isSafari() ||
714+
utils.isAndroidOrIOS() ||
715+
(interaction === 'disabled' && utils.isChromium())
716+
? 'button'
717+
: 'combobox',
714718
title: inputValue,
715719
'aria-autocomplete': undefined,
716720
'aria-readonly': true
717721
}
722+
: interaction === 'disabled' && utils.isChromium()
723+
? { role: 'button' }
718724
: {}
719725

720726
// backdoor to autocomplete attr to work around chrome autofill issues

packages/ui-utils/src/getBrowser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const isIE = () => {
5555
const isChromium = () => {
5656
const chromiumBasedBrowsers = ['Chrome', 'Chromium', 'Opera', 'Edge']
5757
return chromiumBasedBrowsers.some((browser) => {
58-
getBrowser().name?.includes(browser)
58+
return getBrowser().name?.includes(browser)
5959
})
6060
}
6161

0 commit comments

Comments
 (0)