-
Notifications
You must be signed in to change notification settings - Fork 1k
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
New features: moveOnStartChange
, event updates, and more
#31
Conversation
It is not always reliable to use the event itself to find the draggable base. In testing in Chrome, event.currentTarget was always window. event.target was always the clicked element, which may not always be the draggable instance if it has children. The element passed to the event ensures that you always have access to the base element if you need it.
This allows changes to the `start` param to move the element, if desired.
So I just refactored this component on a separate branch. I am trying to decide what is the best way to handle merging all this. Let me pick through your PR and see what makes sense. |
Sure. I'm running a fork in the react-grid-layout project, would be nice
|
All of these updates are finally merged. |
This is kind of a large PR so please let me know if you'd like it split up.
This is some of the work I did on Draggable to help it play nice with my new grid project.
The changes are:
moveOnStartChange
. This flag tells the Draggable to update itsleft
andtop
when thestart
param changes. This is used in React-Grid-Layout to move the Draggables when the layout updates.e.target
, ande.currentTarget
is set incorrectly for some reason. I thought it would be helpful to have.Let me know what you think - if possible it would be great to merge all of the changes rather than split them up.
Thanks