Fix select input styles

This commit is contained in:
Robert Long
2021-12-14 15:28:54 -08:00
parent 284a4ef794
commit 3cc7892198
7 changed files with 45 additions and 56 deletions

View File

@@ -4,7 +4,6 @@ import { useButton } from "@react-aria/button";
import { useSelectState } from "@react-stately/select";
import { Popover } from "./Popover";
import { ListBox } from "./ListBox";
import { useOverlayPosition } from "@react-aria/overlays";
import styles from "./SelectInput.module.css";
import classNames from "classnames";
import { ReactComponent as ArrowDownIcon } from "./icons/ArrowDown.svg";
@@ -21,16 +20,6 @@ export function SelectInput(props) {
const { buttonProps } = useButton(triggerProps, ref);
const popoverRef = useRef();
const { overlayProps } = useOverlayPosition({
targetRef: ref,
overlayRef: popoverRef,
placement: "bottom left",
offset: 5,
isOpen: state.isOpen,
});
return (
<div className={classNames(styles.selectInput, props.className)}>
<h4 {...labelProps} className={styles.label}>
@@ -52,15 +41,12 @@ export function SelectInput(props) {
</button>
{state.isOpen && (
<Popover
ref={popoverRef}
isOpen={state.isOpen}
onClose={state.close}
className={styles.popover}
{...overlayProps}
>
<ListBox
{...menuProps}
className
state={state}
optionClassName={styles.option}
/>