Git Product home page Git Product logo

Comments (4)

STRML avatar STRML commented on June 3, 2024

I think I found the issue; I can reproduce this in most browsers if I simply drag this thing fast enough out of the window.

This is the function for creating a transform:

    function createCSSTransform(style) {
      if (!style.x && !style.y) return {};
      // Replace unitless items with px
      var x = style.x + 'px';
      var y = style.y + 'px';
      return {
        transform: 'translate(' + x + ',' + y + ')',
        WebkitTransform: 'translate(' + x + ',' + y + ')',
        OTransform: 'translate(' + x + ',' + y + ')',
        msTransform: 'translate(' + x + ',' + y + ')',
        MozTransform: 'translate(' + x + ',' + y + ')'
      };
    }

It seems that in some browsers, removing a translation completely causes the element to stay where it was last rendered, instead of being equal to translate(0,0).

One way to fix it is to remove the check on the first line. But I am not sure if this will affect other code. I will spend some more time with it.

from react-draggable.

psaia avatar psaia commented on June 3, 2024

You're right, that definitely fixes is the issue. Interesting. I was thinking it was mouse event related and that a solution similar to this would need to be implemented specific for SVG elements. Nice find.

from react-draggable.

STRML avatar STRML commented on June 3, 2024

This is in 0.7.4.

from react-draggable.

psaia avatar psaia commented on June 3, 2024

Thank you!

from react-draggable.

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.