Skip to content

Commit

Permalink
🐛 Close dropdown after selection or click outside the list (#2077) (#…
Browse files Browse the repository at this point in the history
…2078)

Fix applies to bulk selection dropdown and to filter categories dropdown
on all table-based screens.

Resolves:  https://issues.redhat.com/browse/MTA-3321
Backport-of: #2077

Signed-off-by: Radoslaw Szwajkowski <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
  • Loading branch information
konveyor-ci-bot[bot] authored Sep 4, 2024
1 parent e1c60f1 commit 3236f07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/app/components/FilterToolbar/FilterToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export const FilterToolbar = <TItem, TFilterCategoryKey extends string>({
{!showFiltersSideBySide && (
<ToolbarItem>
<Dropdown
onOpenChange={(flag) => setIsCategoryDropdownOpen(flag)}
toggle={(toggleRef) => (
<MenuToggle
id="filtered-by"
Expand Down
4 changes: 4 additions & 0 deletions client/src/app/components/ToolbarBulkSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const ToolbarBulkSelector = <T,>({
<DropdownItem
onClick={() => {
handleSelectAll(false);
setIsOpen(false);
}}
data-action="none"
key="select-none"
Expand All @@ -91,6 +92,7 @@ export const ToolbarBulkSelector = <T,>({
currentPageItems.map((item: T) => item),
true
);
setIsOpen(false);
}}
data-action="page"
key="select-page"
Expand All @@ -101,6 +103,7 @@ export const ToolbarBulkSelector = <T,>({
<DropdownItem
onClick={() => {
handleSelectAll(true);
setIsOpen(false);
}}
data-action="all"
key="select-all"
Expand All @@ -116,6 +119,7 @@ export const ToolbarBulkSelector = <T,>({
<ToolbarItem>
<Dropdown
isOpen={isOpen}
onOpenChange={(flag) => setIsOpen(flag)}
toggle={(toggleRef) => (
<MenuToggle
ref={toggleRef}
Expand Down

0 comments on commit 3236f07

Please sign in to comment.