|
|
@@ -149,7 +149,8 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
|
|
|
|
|
|
function moveTo(next: number, center = false) {
|
|
|
setStore("selected", next)
|
|
|
- props.onMove?.(selected()!)
|
|
|
+ const option = selected()
|
|
|
+ if (option) props.onMove?.(option)
|
|
|
if (!scroll) return
|
|
|
const target = scroll.getChildren().find((child) => {
|
|
|
return child.id === JSON.stringify(selected()?.value)
|