Skip to content

Commit

Permalink
fix: query DOM element without role for cross-platform compatibility (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
ghiscoding authored Mar 8, 2024
1 parent a0f69e9 commit 1a71fe4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
} from './utils/domUtils';
import type { HtmlElementPosition } from './utils/domUtils';

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

export class MultipleSelectInstance {
protected _bindEventService: BindingEventService;
Expand Down

0 comments on commit 1a71fe4

Please sign in to comment.