It seems that the 'pointermove' listener is being removed when navigating to a different route and not reattaching when navigating back to the route with resizable components. The 'pointerdown' listener remains and will restore the 'pointermove' after a click on the page.
Issue:
I'm using react-resizable-panels version 2.0.19 with @tanstack/react-router 1.34.9. On page refresh, all resizable handles are 'hoverable' and interactive. However, after navigating to a different client side route and back to the route with the resizable components, the resizable handles are not 'hoverable' until the page is clicked. It seems to be an issue with how the event listeners are being created/removed. Or perhaps this is some sort of optimization...
My hacky fix:
I've temporarily restored the behavior by calling some pointer events and this seems to reattach the 'pointermove' listener...
// A parent component of the resizable components
useEffect(() => {
const doClick = () => {
;['pointerdown', 'pointerup'].forEach((eventType) => {
window.dispatchEvent(
new PointerEvent(eventType, {
bubbles: true,
cancelable: true,
view: window,
}),
)
})
}
const timeoutId = setTimeout(doClick, 100) // Seemingly only works with a timeout
return () => clearTimeout(timeoutId)
}, [])
Bottom line up front:
It seems that the 'pointermove' listener is being removed when navigating to a different route and not reattaching when navigating back to the route with resizable components. The 'pointerdown' listener remains and will restore the 'pointermove' after a click on the page.
Issue:
I'm using react-resizable-panels version 2.0.19 with @tanstack/react-router 1.34.9. On page refresh, all resizable handles are 'hoverable' and interactive. However, after navigating to a different client side route and back to the route with the resizable components, the resizable handles are not 'hoverable' until the page is clicked. It seems to be an issue with how the event listeners are being created/removed. Or perhaps this is some sort of optimization...
My hacky fix:
I've temporarily restored the behavior by calling some pointer events and this seems to reattach the 'pointermove' listener...