Merge pull request #183 from acid-info/searchbox

Quick fix a bug with whereResultsStick on iOS
This commit is contained in:
jeangovil 2023-09-06 18:52:21 +03:30 committed by GitHub
commit 1af3777502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -123,16 +123,19 @@ const SearchBox = (props: SearchBoxProps) => {
}, [focused, queryInput])
useEffect(() => {
if (filtersRef.current) {
if (filtersRef.current && hydrated && queryInput) {
const filtersB = filtersRef.current.getBoundingClientRect().bottom
const parentT =
filtersRef.current.parentElement?.getBoundingClientRect().top || 0
const whereResultsStick =
-1 * (filtersB - parentT - uiConfigs.navbarRenderedHeight + 2)
setWhereResultsStick(whereResultsStick)
setDetailsTop(filtersB + whereResultsStick)
}
}, [])
}, [filtersRef, hydrated, queryInput])
useEffect(() => {
const onScroll = () => {