bugfix: 修复搜索背景遮罩无法点击

This commit is contained in:
tangly1024
2022-01-11 10:51:05 +08:00
parent 69abbd8e3e
commit c2906083c3

View File

@@ -13,6 +13,7 @@ const SearchDrawer = ({ cRef }) => {
}
})
const hidden = () => {
console.log('点击')
searchDrawer?.current?.classList?.add('hidden')
}
Router.events.on('routeChangeComplete', (...args) => {
@@ -20,14 +21,14 @@ const SearchDrawer = ({ cRef }) => {
})
return (
<div id='search-drawer-wrapper' ref={searchDrawer} className='hidden'>
<div className='flex absolute px-5 w-full h-full left-0 top-14 z-50 justify-center'>
<div className='flex absolute px-5 w-full left-0 top-14 z-50 justify-center'>
<div className='md:max-w-3xl w-full mx-auto animate__animated animate__faster animate__fadeIn'>
<SearchInput cRef={searchInputRef} />
</div>
</div>
{/* 背景蒙版 */}
<div id='search-drawer-background' onClick={hidden} className='animate__animated animate__faster animate__fadeIn fixed glassmorphism top-0 left-0 z-30 w-full h-full' />
<div id='search-drawer-background' onClick={hidden} className='animate__animated animate__faster animate__fadeIn fixed glassmorphism top-0 left-0 z-40 w-full h-full' />
</div>
)
}