Closed frankvdb7 closed 1 year ago
@frankvdb7
click is an event that fires when mouseup occurs.
Try using e.isDragStart instead of e.isClick for selectEnd that occurred on mousedown.
@daybrush Thanks for your response.
We are using isDragStart for the moment, but we are also calling the moveable.dragStart method when e.isDragStart is true. The main problem is that we have some logic that calls moveable updateTarget method as soon as the width/height changes externally. This however causes a 'flash' of snapping guidelines if you click on the element.
Example: https://codesandbox.io/s/cool-pare-xue0c6
I checked the documentation of moveable again and it seems that useResizeObserver may solve the width/height external change for us. So we no longer have to use the updateTarget in this case. I will test this again and close this ticket if its solved.
Thanks again.
EDIT: I fixed my issue by using useResizeObserver and some custom logic to also check if the position changed and update the moveable target accordingly.
Environments
Description
We are currently experiencing a bug with the Selecto component that the onSelectEnd event onClick property is false when clicking a selectable element, while it should be true. Clicking just outside the element sets the isClick property to true.
We'd expect the onSelectEnd event isClick property to be true in any case where there is a click (so if the mouse down and up is released within a certain time frame).
Please check the example for reference.
Thanks