You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#9852 made the Loadout Popup overflow: hidden with a call to useFixOverscrollBehavior (that internally uses useResizeObserver) to restore overflow: auto in case the popup actually does overflow. In practice, the Loadout Popup would remain unscrollable and nev changed it to overflow: auto in 4aa708f. According to comments in #9852 this would regress overscroll behavior in Safari however:
Safari seems very sensitive about what overflow values an element has to start with - starting with auto and setting to hidden doesn't work, but starting from hidden and setting to auto does.
So we should fix whatever makes useFixOverscrollBehavior not work correctly here:
Since StoreHeading first renders (and calls the hook) with a closed popup, the hook doesn't have a target element to subscribe, and when it does finally open and StoreHeading re-renders, none of the dependencies of useResizeObserver's layoutEffect change (since they're only ref objects or globals), so the subscription of the ResizeObserver never happens with the correct element.
The text was updated successfully, but these errors were encountered:
#9852 made the Loadout Popup
overflow: hidden
with a call touseFixOverscrollBehavior
(that internally usesuseResizeObserver
) to restoreoverflow: auto
in case the popup actually does overflow. In practice, the Loadout Popup would remain unscrollable and nev changed it tooverflow: auto
in 4aa708f. According to comments in #9852 this would regress overscroll behavior in Safari however:So we should fix whatever makes
useFixOverscrollBehavior
not work correctly here:DIM/src/app/character-tile/StoreHeading.tsx
Line 98 in 4aa708f
and then revert 4aa708f.
My hunch is that
useResizeObserver
can't deal with the ref target changing in subsequent renders:https://github.com/jaredLunde/react-hook/blob/3c813dab5b21e26f2c85e733314ca5c063c6bfce/packages/resize-observer/src/index.tsx#L24-L50
Since
StoreHeading
first renders (and calls the hook) with a closed popup, the hook doesn't have a target element to subscribe, and when it does finally open andStoreHeading
re-renders, none of the dependencies ofuseResizeObserver
'slayoutEffect
change (since they're only ref objects or globals), so the subscription of the ResizeObserver never happens with the correct element.The text was updated successfully, but these errors were encountered: