react-resizable
react-resizable copied to clipboard
Provide onClick handler for resize handle to allow prevent click on resizable parent
- [x] Bug
- [x] Feature Request
- [ ] Question
Problem Report
After resizing, handler and its parent receive click. If it is sensitive to click, like sortable column header, then it causes a problem.
Solution:
Please provide onClick handler via api to allow to stopPropagation of the click to a parent. Another solution is to provide API flag e.g. preventClick and call it yourself. Thanks.
<Resizable
handle={renderResizeHandle}
>
</Resizable>
const renderResizeHandle = resizeHandle => {
return (
<span
className={react-resizable-handle react-resizable-handle-${resizeHandle}
}
onClick={e => {
e.stopPropagation()
}}
/>
)
}
could solve this problem
<Resizable handle={renderResizeHandle} > </Resizable>
const renderResizeHandle = resizeHandle => { return ( <span className={
react-resizable-handle react-resizable-handle-${resizeHandle}
} onClick={e => { e.stopPropagation() }} /> ) }could solve this problem
I have the same problem and this worked for me.
If you are using typescript and this repo the prop handle
is missing.