-
Notifications
You must be signed in to change notification settings - Fork 149
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 transform to potential conflict attributes #130
base: master
Are you sure you want to change the base?
Conversation
Hi @timruffles, Have a use case where the items I want to drag already have transform on they're style, making the transform empty string fixes my issue of having the image outside the view port.
Welcome and thanks for your contribution :) Can you provide a demo of your use case? I'm afraid this change could break existing polyfill users that might rely on the transform style being present on some nested node of a draggable element. Would it be enough to clear the transform of the drag image element instead of clearing it on all child nodes? Meanwhile you can apply your changes with a custom dragImageSetup function, see https://github.com/timruffles/mobile-drag-drop#custom-drag-image-setup-function It's available starting v2.3.0-rc.0 |
Yes it will be enough to set it on the drag image only, now I saw that the function goes recursive through all children. Will be that ok? And yes was also thinking in making my own function for On the library I work, I position elements with transform. |
Ok added the empty transform only for the first node. |
I'm not capable of reviewing your PR right away because of little to no free time. Planning to get to it done next weekend but can't make a promise here. The change needs thorough review because there is some transform related regex stuff in the polyfill where I need to make sure we're not breaking others - will need to set up some demo content with extensive transform usage to make sure all is working as expected. |
No problem, have little free time also. |
The more I look at the code involved the more I think your suggestion is the cleaner approach. It would also allow to remove the current regex transform fiddling which is fragile because it does not cover all the variants that are possible on the transform property. Changing this part of the code has a high risk of breaking someone that might rely on current behaviour so this likely requires a major version bump. |
Hi @timruffles,
Have a use case where the items I want to drag already have transform on they're style, making the transform empty string fixes my issue of having the image outside the view port.