-
-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add activatorEvent to DragStartEvent #1140
Add activatorEvent to DragStartEvent #1140
Conversation
🦋 Changeset detectedLatest commit: 545a41c The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
5ff4b1b
to
545a41c
Compare
@clauderic Is this something that can be merged in? |
@clauderic Sorry to bump this again, but, I think due to #832 and this not being merged, right now it seems next to impossible to get information on the location of a drag start. Would it be possible to merge this? :) |
Pretty please? |
🙏 |
You can access the onDragStart event data using this way. Add an custom const ResizeHandle = ({ id, axis, side, onResizeStart, onResize }) => {
const { attributes, listeners, setNodeRef, transform } = useDraggable({
id,
});
useEffect(() => {
if (transform) {
onResize(transform, id);
}
}, [transform, onResize, id]);
const handleMouseDown = (e) => {
onResizeStart(e, id);
if (listeners.onMouseDown) {
listeners.onMouseDown(e);
}
};
return (
<div
ref={setNodeRef}
{...listeners}
{...attributes}
onMouseDown={handleMouseDown}
className={`resize-handle resize-handle-${axis} resize-handle-${side}`}>
<div className='wphave-handle' />
</div>
);
}; |
Also need the activatorEvent in dragStart. Will implement a sketchy work-around for now |
Fixes #1139.