Skip to content

Commit

Permalink
fix(TableToolbarSearch): fix focus management (#5872)
Browse files Browse the repository at this point in the history
This change checks if there was actual change in the expanded state of
`<TableToolbarSearch>`, to set the focus upon expanding.

Fixes #5852.
  • Loading branch information
asudoh authored and joshblack committed Apr 23, 2020
1 parent 42e7ddd commit 84a1198
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const TableToolbarSearch = ({
const handleExpand = (event, value = !expanded) => {
if (!controlled && (!persistent || (!persistent && !persistant))) {
setExpandedState(value);
if (value) {
if (value && !expanded) {
setFocusTarget(searchRef);
}
}
Expand Down

0 comments on commit 84a1198

Please sign in to comment.