mirror of
https://github.com/outline/outline.git
synced 2026-11-30 17:10:36 +03:00
Fixes: Search filter dropdown should close on selection
This commit is contained in:
1 parent
6d03257cc1
commit
bc918b7bf5
2 files changed
+17
-11
No files matched your search
@@ -44,6 +44,7 @@ const Anchor = styled('a')`
|
||||
|
||||
${HelpText} {
|
||||
font-weight: normal;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -31,16 +31,21 @@ const FilterOptions = ({
|
||||
|
||||
return (
|
||||
<DropdownButton label={activeKey ? selectedLabel : defaultLabel}>
|
||||
<List>
|
||||
{options.map(option => (
|
||||
<FilterOption
|
||||
key={option.key}
|
||||
onSelect={() => onSelect(option.key)}
|
||||
active={option.key === activeKey}
|
||||
{...option}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
{({ closeMenu }) => (
|
||||
<List>
|
||||
{options.map(option => (
|
||||
<FilterOption
|
||||
key={option.key}
|
||||
onSelect={() => {
|
||||
onSelect(option.key);
|
||||
closeMenu();
|
||||
}}
|
||||
active={option.key === activeKey}
|
||||
{...option}
|
||||
/>
|
||||
))}
|
||||
</List>
|
||||
)}
|
||||
</DropdownButton>
|
||||
);
|
||||
};
|
||||
@@ -78,7 +83,7 @@ const SearchFilter = props => {
|
||||
>
|
||||
{({ closePortal }) => (
|
||||
<MaxHeightScrollable>
|
||||
<Content>{props.children}</Content>
|
||||
<Content>{props.children({ closeMenu: closePortal })}</Content>
|
||||
</MaxHeightScrollable>
|
||||
)}
|
||||
</DropdownMenu>
|
||||
|
||||
Reference in new issue
Block a user