fix: fix a bug with whereResultsStick
This commit is contained in:
parent
4ec9d0ed84
commit
91a7b35682
|
@ -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 = () => {
|
||||
|
|
Loading…
Reference in New Issue