react-resizable icon indicating copy to clipboard operation
react-resizable copied to clipboard

Provide onClick handler for resize handle to allow prevent click on resizable parent

Open urrri opened this issue 5 years ago • 2 comments

  • [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.

urrri avatar May 30 '19 11:05 urrri

<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

LeeDou avatar Jul 11 '19 03:07 LeeDou

<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.

afvieira avatar Sep 21 '19 15:09 afvieira