|
|
@ -34,6 +34,14 @@ export default function WidthHandler(props) {
|
|
|
|
return () => window.removeEventListener('mousemove', handleMouseMove)
|
|
|
|
return () => window.removeEventListener('mousemove', handleMouseMove)
|
|
|
|
}, [innerRef, onChange])
|
|
|
|
}, [innerRef, onChange])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
|
|
|
function handleMouseUp() {
|
|
|
|
|
|
|
|
startX.current = null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('mouseup', handleMouseUp)
|
|
|
|
|
|
|
|
return () => window.removeEventListener('mouseup', handleMouseUp)
|
|
|
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
// eslint-disable-next-line
|
|
|
|
// eslint-disable-next-line
|
|
|
|
<div
|
|
|
|
<div
|
|
|
@ -42,9 +50,6 @@ export default function WidthHandler(props) {
|
|
|
|
startX.current = e.pageX
|
|
|
|
startX.current = e.pageX
|
|
|
|
startWidth.current = innerRef.current.clientWidth
|
|
|
|
startWidth.current = innerRef.current.clientWidth
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
onMouseUp={() => {
|
|
|
|
|
|
|
|
startX.current = null
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
role="separator"
|
|
|
|
role="separator"
|
|
|
|
aria-orientation="vertical"
|
|
|
|
aria-orientation="vertical"
|
|
|
|
aria-valuemin={minWidth}
|
|
|
|
aria-valuemin={minWidth}
|
|
|
|