Coder Social home page Coder Social logo

Comments (8)

taye avatar taye commented on May 15, 2024

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.

taye avatar taye commented on May 15, 2024

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.

taye avatar taye commented on May 15, 2024

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.

braaam avatar braaam commented on May 15, 2024

Hi,

Thanks for the fix. Sorry for slow response, gonna test it this afternoon.

from interact.js.

braaam avatar braaam commented on May 15, 2024

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.

taye avatar taye commented on May 15, 2024

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.

braaam avatar braaam commented on May 15, 2024

Yes, it's fixed, thanks!

from interact.js.

taye avatar taye commented on May 15, 2024

Awesome. Thanks for reporting the issue.

from interact.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.