Fix select input styles
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user