Skip to content

Commit

Permalink
fix(dropdown): add focus trap option that allows close on click
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Jan 4, 2019
1 parent 8e0f86e commit aef16d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const DropdownMenu = ({ className, isOpen, position, children, component: Compon
);
} else if (Component === 'ul') {
menu = (
<FocusTrap>
<FocusTrap focusTrapOptions={{
clickOutsideDeactivates: true
}}>
<Component
{...props}
className={css(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,11 @@ exports[`KebabToggle expanded 1`] = `
<FocusTrap
_createFocusTrap={[Function]}
active={true}
focusTrapOptions={Object {}}
focusTrapOptions={
Object {
"clickOutsideDeactivates": true,
}
}
paused={false}
tag="div"
>
Expand Down Expand Up @@ -2103,7 +2107,11 @@ exports[`dropdown expanded 1`] = `
<FocusTrap
_createFocusTrap={[Function]}
active={true}
focusTrapOptions={Object {}}
focusTrapOptions={
Object {
"clickOutsideDeactivates": true,
}
}
paused={false}
tag="div"
>
Expand Down

0 comments on commit aef16d5

Please sign in to comment.