fix: animation on resolving SelectModelPopup (#5947)

This commit is contained in:
one 2025-05-13 13:22:24 +08:00 committed by GitHub
parent 487c864860
commit cb98e49d75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -278,12 +278,11 @@ const PopupContainer: React.FC<Props> = ({ model, resolve }) => {
const handleItemClick = useCallback( const handleItemClick = useCallback(
(item: FlatListItem) => { (item: FlatListItem) => {
if (item.type === 'model') { if (item.type === 'model') {
setScrollTrigger('initial')
resolve(item.model) resolve(item.model)
setOpen(false) setOpen(false)
} }
}, },
[resolve, setScrollTrigger] [resolve]
) )
// 处理键盘导航 // 处理键盘导航
@ -651,16 +650,7 @@ export class SelectModelPopup {
static show(params: PopupParams) { static show(params: PopupParams) {
return new Promise<Model | undefined>((resolve) => { return new Promise<Model | undefined>((resolve) => {
TopView.show( TopView.show(<PopupContainer {...params} resolve={(v) => resolve(v)} />, TopViewKey)
<PopupContainer
{...params}
resolve={(v) => {
resolve(v)
TopView.hide(TopViewKey)
}}
/>,
TopViewKey
)
}) })
} }
} }