diff --git a/src/lib/components/menu/button.tsx b/src/lib/components/menu/button.tsx index a54ec8d6..fc0df9de 100644 --- a/src/lib/components/menu/button.tsx +++ b/src/lib/components/menu/button.tsx @@ -30,7 +30,7 @@ export function ButtonMenu({ refMenu, style, setExpanded, - } = useMenu({ classNameOverride, id }); + } = useMenu({ classNameOverride, element: "Button", id }); return (
diff --git a/src/lib/components/menu/index.ts b/src/lib/components/menu/index.ts index 1d0171d6..9334b392 100644 --- a/src/lib/components/menu/index.ts +++ b/src/lib/components/menu/index.ts @@ -32,12 +32,14 @@ export type MenuOption = export function useMenu({ classNameOverride, + element, flex, id, }: { flex?: boolean; id: string; classNameOverride?: string; + element: "Button" | "Input"; }) { const [expanded, setExpanded] = useState(false); const refControl = useRef(null); @@ -98,8 +100,7 @@ export function useMenu({ className: classNames({ [styles.fieldset]: true, [styles.flex]: flex, - [refControl instanceof HTMLInputElement ? styles.input : styles.button]: - true, + [element === "Button" ? styles.button : styles.input]: true, classNameOverride, }), expanded, diff --git a/src/lib/components/menu/input.tsx b/src/lib/components/menu/input.tsx index 28be8c50..1e79688f 100644 --- a/src/lib/components/menu/input.tsx +++ b/src/lib/components/menu/input.tsx @@ -37,7 +37,12 @@ export const InputMenu = forwardRef< refMenu, setExpanded, style, - } = useMenu({ classNameOverride, flex, id }); + } = useMenu({ + classNameOverride, + element: "Input", + flex, + id, + }); return (