diff --git a/packages/eui/changelogs/upcoming/8091.md b/packages/eui/changelogs/upcoming/8091.md new file mode 100644 index 00000000000..03c50c190c4 --- /dev/null +++ b/packages/eui/changelogs/upcoming/8091.md @@ -0,0 +1,7 @@ +**Accessibility** + +- Ensures `autoFocus` on `EuiSelectableList` triggers initial focus +- Improved the accessibility of `EuiSearchBarFilters` by: + - adding a more descriptive `aria-label` to selection filter buttons + - ensuring the selection listbox is initially focused when opening a selection popover + diff --git a/packages/eui/src/components/popover/popover.tsx b/packages/eui/src/components/popover/popover.tsx index d78b25eb1dd..ec45cc3b036 100644 --- a/packages/eui/src/components/popover/popover.tsx +++ b/packages/eui/src/components/popover/popover.tsx @@ -375,7 +375,7 @@ export class EuiPopover extends Component { // it will be on the panel instead on mount when isOpen=true if ( document.activeElement === document.body || - document.activeElement === this.panel + this.panel?.contains(document.activeElement) // if focus is on OR within this.panel ) { if (!this.button) return; diff --git a/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap b/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap index 08c3a91eca2..c39d00b2a02 100644 --- a/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap +++ b/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap @@ -160,6 +160,7 @@ exports[`SearchBar render - provided query, filters 1`] = ` class="euiPopover emotion-euiPopover-inline-block" >