mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-04 23:40:48 +00:00
wip: desktop work
This commit is contained in:
parent
1dba01e057
commit
335d833655
9 changed files with 220 additions and 99 deletions
|
|
@ -9,6 +9,7 @@ export interface ListProps<T> {
|
|||
key: (x: T) => string
|
||||
current?: T
|
||||
onSelect?: (value: T | undefined) => void
|
||||
onHover?: (value: T | undefined) => void
|
||||
class?: ComponentProps<"div">["class"]
|
||||
}
|
||||
|
||||
|
|
@ -45,6 +46,7 @@ export function List<T>(props: ListProps<T>) {
|
|||
createEffect(() => {
|
||||
if (store.mouseActive || props.data.length === 0) return
|
||||
const index = props.data.findIndex((x) => props.key(x) === list.active())
|
||||
props.onHover?.(props.data[index])
|
||||
if (index === 0) {
|
||||
virtualizer()?.scrollTo(0)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue