diff --git a/desktop/src/ui/components/base/Dropdown.module.scss b/desktop/src/ui/components/base/Dropdown.module.scss index 20ffb27d..ff52cc8c 100644 --- a/desktop/src/ui/components/base/Dropdown.module.scss +++ b/desktop/src/ui/components/base/Dropdown.module.scss @@ -1,11 +1,11 @@ .dropdown { - @apply relative; + @apply relative w-52; .row { - @apply flex flex-row justify-start items-center gap-1.5 h-4; + @apply w-full flex flex-row justify-start items-center gap-1.5 h-4 text-nowrap overflow-hidden; > svg { - @apply w-4 h-4; + @apply min-w-4 min-h-4 w-4 h-4; } } diff --git a/desktop/src/ui/components/base/Dropdown.tsx b/desktop/src/ui/components/base/Dropdown.tsx index a4800944..d492cac0 100644 --- a/desktop/src/ui/components/base/Dropdown.tsx +++ b/desktop/src/ui/components/base/Dropdown.tsx @@ -1,17 +1,19 @@ -import { Index, type JSX, type ParentProps, children, createSignal } from 'solid-js'; +import { Index, type JSX, type ParentProps, children, createEffect, createSignal, splitProps } from 'solid-js'; import { ChevronDownIcon } from '@untitled-theme/icons-solid'; import Popup from '../overlay/Popup'; import Button from './Button'; import styles from './Dropdown.module.scss'; -export type DropdownProps = ParentProps; +export type DropdownProps = JSX.HTMLAttributes; function Dropdown(props: DropdownProps) { + const [split, rest] = splitProps(props, ['children', 'class']); const [visible, setVisible] = createSignal(false); const [selected, setSelected] = createSignal(0); + let ref!: HTMLDivElement; - const items = () => children(() => props.children).toArray(); + const items = () => children(() => split.children).toArray(); function select(index: number) { setSelected(index); @@ -19,24 +21,17 @@ function Dropdown(props: DropdownProps) { } return ( -
+
@@ -44,7 +39,7 @@ function Dropdown(props: DropdownProps) { mount={ref} visible={visible} setVisible={setVisible} - ref={ref => ref.classList.add('mt-1', 'left-0', 'right-0')} + ref={ref => ref.classList.add('mt-1', 'w-full')} >
diff --git a/desktop/src/ui/pages/browser/BrowserMain.tsx b/desktop/src/ui/pages/browser/BrowserMain.tsx index 45bc6caa..6be041d3 100644 --- a/desktop/src/ui/pages/browser/BrowserMain.tsx +++ b/desktop/src/ui/pages/browser/BrowserMain.tsx @@ -40,7 +40,7 @@ function BrowserMain() {
} /> - +

Test