|
1 | | -import { FloatingPortal } from "@floating-ui/react"; |
2 | 1 | import classNames from "classnames"; |
3 | 2 | import { createElement, useMemo } from "react"; |
4 | 3 | import { useSelect } from "./useSelect"; |
@@ -39,29 +38,26 @@ export function FilterSelector(props: FilterSelectorProps): React.ReactElement { |
39 | 38 | > |
40 | 39 | |
41 | 40 | </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> |
65 | 61 | </div> |
66 | 62 | </div> |
67 | 63 | ); |
|
0 commit comments