Skip to content

Commit

Permalink
Fix focus state of the changing all filters button after closing popo…
Browse files Browse the repository at this point in the history
…ver (#93475) (#94919)
  • Loading branch information
dokmic committed Mar 18, 2021
1 parent 1592e3c commit 8a54a3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/data/public/ui/filter_bar/filter_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ interface State {
}

class FilterOptionsUI extends Component<Props, State> {
private buttonRef = React.createRef<HTMLButtonElement>();

public state: State = {
isPopoverOpen: false,
};
Expand All @@ -39,6 +41,7 @@ class FilterOptionsUI extends Component<Props, State> {

public closePopover = () => {
this.setState({ isPopoverOpen: false });
this.buttonRef.current?.focus();
};

public render() {
Expand Down Expand Up @@ -151,6 +154,7 @@ class FilterOptionsUI extends Component<Props, State> {
defaultMessage: 'Change all filters',
})}
data-test-subj="showFilterActions"
buttonRef={this.buttonRef}
/>
}
anchorPosition="rightUp"
Expand Down

0 comments on commit 8a54a3d

Please sign in to comment.