Skip to content
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

Can't work correctly on elements that use animation or transitions #151

Open
baocang opened this issue Jul 17, 2019 · 2 comments
Open

Can't work correctly on elements that use animation or transitions #151

baocang opened this issue Jul 17, 2019 · 2 comments

Comments

@baocang
Copy link

baocang commented Jul 17, 2019

I just solved the problem by ignoring animations and transitions.

if (!(/animation/.test(csName)) && !(/transition/.test(csName))) {
    dstNode.style.setProperty(csName, cs.getPropertyValue(csName), cs.getPropertyPriority(csName));
}
@reppners
Copy link
Collaborator

Thanks for reporting and posting your solution. Can you provide a small showcase of the problem or example CSS styles so I can reproduce the issue and play with it?

@baocang
Copy link
Author

baocang commented Jul 22, 2019

npx create-react-app
npm install mobile-drag-drop --save
import {polyfill} from "mobile-drag-drop";

// optional import of scroll behaviour
import {scrollBehaviourDragImageTranslateOverride} from "mobile-drag-drop/scroll-behaviour";

// options are optional ;)
polyfill({
    // use this to make use of the scroll behaviour
    dragImageTranslateOverride: scrollBehaviourDragImageTranslateOverride
});
.App-logo {
  animation: App-logo-spin infinite 20s linear;
  height: 40vmin;
  /* pointer-events: none; */
}
<img src={logo} className="App-logo" alt="logo" draggable />

Screen Shot 2019-07-23 at 2 12 53 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants