Comments (8)
Using a very simple non native indexOf
would be fine. The way the method is used internally, it could just be a straight forward for loop + comparison. A pull request would be more than welcome.
I'll try later to also avoid changing prototypes for Element#matchesSelector
, Event#preventDefault
and Event#stopPropagation
.
from interact.js.
I have some free time now so I think I'll redo all of those methods myself if you haven't already started.
from interact.js.
I've made the changes in a new branch. Could you try this version to check if the issue you were having is fixed: https://rawgit.com/taye/interact.js/dont-modify-native-prototypes/interact.js?
Edit: corrected the URL
from interact.js.
Hi,
Thanks for the fix. Sorry for slow response, gonna test it this afternoon.
from interact.js.
There is still a problem when a string is fed to the isElement function. I've changed the first comparison which fixes it.
function isElement (o) {
return (typeof o === 'object') && (
typeof Element === "object" ? o instanceof Element : //DOM2
o && typeof o === "object" && o !== null && o.nodeType === 1 && typeof o.nodeName==="string"
);
}
from interact.js.
I've added your change. Can you confirm that it works correctly? https://rawgit.com/taye/interact.js/dont-modify-native-prototypes/interact.js
from interact.js.
Yes, it's fixed, thanks!
from interact.js.
Awesome. Thanks for reporting the issue.
from interact.js.
Related Issues (20)
- Missing TypeScript types (e.g. `styleCursor` option) HOT 1
- Issue on dropzones with 1.10.20 release HOT 7
- How to implement elements snapping to each other functionality? HOT 1
- @Interacrt/Interact cannot trigger the move event
- draggable and gesturable div, behavior lock with inertia
- Issue with Module Parsing in Project Using react-multi-crops HOT 3
- Vite production builds fail after v1.10.25
- TypeScript compile errors - version 1.10.26 HOT 4
- Resize modifier - wrong types HOT 1
- Gestures not working in ShadowDom
- Incompatible with Angular (v17) HOT 3
- New Snap syntax not working HOT 1
- Can't drag element when wrap drag item inside div HOT 1
- Restricting a drag with parent as origin. HOT 4
- Set snap on or off by user
- Demo Page down (https://interactjs.io/) HOT 1
- Is there a way to set the z-index of dropactive?
- interactjs.io is down
- mouseButtons typescript type definitions
- Web server is down (interactjs.io) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from interact.js.