Skip to content

Commit

Permalink
fix(TableToolbarSearch): set focus on expanded search bar (carbon-des…
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod authored and renmaddox committed Mar 20, 2020
1 parent 8370de4 commit a5280c9
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 a5280c9

Please sign in to comment.