Skip to content

Commit 1a71fe4

Browse files
authored
fix: query DOM element without role for cross-platform compatibility (#237)
- I was a little bit surprised about this but on certain platform (mainly Salesforce in my case), the `role` attributes are completely stripped. So the DOM query I had for arrow highlight navigation wasn't working in Salesforce. So removing `[role]` query selector but adding another type of attribute to keep query still focused with `li[datakey]` is enough to get it working in Salesforce
1 parent a0f69e9 commit 1a71fe4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/multiple-select-vanilla/src/MultipleSelectInstance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import {
2020
} from './utils/domUtils';
2121
import type { HtmlElementPosition } from './utils/domUtils';
2222

23-
const OPTIONS_LIST_SELECTOR = '.ms-select-all, ul[role=combobox] li[role=option]';
24-
const OPTIONS_HIGHLIGHT_LIST_SELECTOR = '.ms-select-all.highlighted, ul[role=combobox] li[role=option].highlighted';
23+
const OPTIONS_LIST_SELECTOR = '.ms-select-all, ul li[data-key]';
24+
const OPTIONS_HIGHLIGHT_LIST_SELECTOR = '.ms-select-all.highlighted, ul li[data-key].highlighted';
2525

2626
export class MultipleSelectInstance {
2727
protected _bindEventService: BindingEventService;

0 commit comments

Comments
 (0)