summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/ui/src')
-rw-r--r--packages/ui/src/components/list.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/ui/src/components/list.tsx b/packages/ui/src/components/list.tsx
index cb212d1a8..aaba61fdf 100644
--- a/packages/ui/src/components/list.tsx
+++ b/packages/ui/src/components/list.tsx
@@ -23,6 +23,10 @@ export function List<T>(props: ListProps<T>) {
initialActive: props.current ? props.key(props.current) : undefined,
loop: true,
})
+
+ createEffect(() => {
+ if (props.current) list.setActive(props.key(props.current))
+ })
// const resetSelection = () => {
// if (props.data.length === 0) return
// list.setActive(props.key(props.data[0]))