Skip to content

Commit

Permalink
fix(TableToolbarSearch): set focus on expanded search bar (#5637)
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored and Alessandra Davila committed Mar 18, 2020
1 parent 27b677a commit d6916b5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,16 @@ const TableToolbarSearch = ({
const handleExpand = (event, value = !expanded) => {
if (!controlled && (!persistent || (!persistent && !persistant))) {
setExpandedState(value);
if (value) {
setFocusTarget(searchRef);
}
}
if (onExpand) {
onExpand(event, value);
}
};

const onClick = e => {
setFocusTarget(searchRef);
handleExpand(e, true);
};

Expand Down

0 comments on commit d6916b5

Please sign in to comment.