列表不会带动搜索框转

This commit is contained in:
CrescentLeaf
2025-11-23 12:34:18 +08:00
parent 2cf9a20910
commit f13623f4fc
2 changed files with 90 additions and 75 deletions

View File

@@ -44,7 +44,11 @@ export default function RecentsList({
}
updateRecents()
EventBus.on('RecentsList.updateRecents', () => updateRecents())
setTimeout(() => updateRecents(), 15 * 1000)
const id = setInterval(() => updateRecents(), 15 * 1000)
return () => {
EventBus.off('RecentsList.updateRecents')
clearInterval(id)
}
})
return <mdui-list style={{
@@ -58,6 +62,10 @@ export default function RecentsList({
<mdui-text-field icon="search" type="search" clearable ref={searchRef} variant="outlined" placeholder="搜索..." style={{
marginTop: '5px',
marginBottom: '13px',
position: 'sticky',
top: '0',
backgroundColor: 'rgb(var(--mdui-color-background))',
zIndex: '10',
}}></mdui-text-field>
{
recentsList.filter((chat) =>