Skip to content

Commit c2a90b4

Browse files
committed
Revert "fix(widget-plugin-filtering): wrap popup in FloatingPortal"
This reverts commit 2b98412.
1 parent fc7c1b8 commit c2a90b4

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

packages/shared/widget-plugin-filtering/src/controls/filter-selector/FilterSelector.tsx

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { FloatingPortal } from "@floating-ui/react";
21
import classNames from "classnames";
32
import { createElement, useMemo } from "react";
43
import { useSelect } from "./useSelect";
@@ -39,29 +38,26 @@ export function FilterSelector(props: FilterSelectorProps): React.ReactElement {
3938
>
4039
 
4140
</button>
42-
{open && (
43-
<FloatingPortal>
44-
<ul
45-
className={classNames("filter-selectors", { hidden: !open, visible: open })}
46-
{...listboxProps}
47-
style={floatingStyles}
48-
>
49-
{options.map((item, index) => (
50-
<li
51-
className={classNames("filter-listitem", {
52-
"filter-selected": selectedItem?.value === item.value,
53-
"filter-highlighted": highlightedIndex === index
54-
})}
55-
key={item.value}
56-
{...getItemProps({ item, index })}
57-
>
58-
<div className={classNames("filter-icon", item.value)} aria-hidden />
59-
<div className="filter-label">{item.caption}</div>
60-
</li>
61-
))}
62-
</ul>
63-
</FloatingPortal>
64-
)}
41+
<ul
42+
className={classNames("filter-selectors", { hidden: !open, visible: open })}
43+
{...listboxProps}
44+
style={floatingStyles}
45+
>
46+
{open &&
47+
options.map((item, index) => (
48+
<li
49+
className={classNames("filter-listitem", {
50+
"filter-selected": selectedItem?.value === item.value,
51+
"filter-highlighted": highlightedIndex === index
52+
})}
53+
key={item.value}
54+
{...getItemProps({ item, index })}
55+
>
56+
<div className={classNames("filter-icon", item.value)} aria-hidden />
57+
<div className="filter-label">{item.caption}</div>
58+
</li>
59+
))}
60+
</ul>
6561
</div>
6662
</div>
6763
);

0 commit comments

Comments
 (0)