mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
feat(ui): add onFilter callback to List, discard add server row when searching
This commit is contained in:
parent
df4d839577
commit
8845f2b926
2 changed files with 7 additions and 0 deletions
|
|
@ -38,6 +38,7 @@ export interface ListProps<T> extends FilteredListProps<T> {
|
|||
loadingMessage?: string
|
||||
onKeyEvent?: (event: KeyboardEvent, item: T | undefined) => void
|
||||
onMove?: (item: T | undefined) => void
|
||||
onFilter?: (value: string) => void
|
||||
activeIcon?: IconProps["name"]
|
||||
filter?: string
|
||||
search?: ListSearchProps | boolean
|
||||
|
|
@ -98,6 +99,7 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
|
|||
const current = internalFilter()
|
||||
if (prev !== current) {
|
||||
onInput(current)
|
||||
props.onFilter?.(current)
|
||||
}
|
||||
return current
|
||||
}, "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue