anseki / plain-draggable

The simple and high performance library to allow HTML/SVG element to be dragged.
https://anseki.github.io/plain-draggable/
MIT License
773 stars 99 forks source link

draggable will get a wrong position when it contained in a transform scaled scroll element. #54

Closed towify closed 4 years ago

towify commented 4 years ago

Hi, Here are the steps to reproduce the Bug

  1. created an scrollable element
  2. create two or more draggable elements in the scrollable element.
  3. transform scale the scrollable element
  4. scroll the content.
  5. draggable elements got very wrong position, sometimes they will be disappear.
towify commented 4 years ago

@anseki , hi , this bug depends on the container element transform scale value , i think that could you provide a method , set the scale scale modulus, i guess it will be work. any way, I really hope you can fix this problem. i really like this library. : )

anseki commented 4 years ago

Hi @towify, thank you for the comment. That is not bug, that is correct behavior of DOM. I might be able to help you if you reply to my message in another issue.

anseki commented 4 years ago

You ignored my messages many times, then I can't understand your situation. Please understand that the information is required for helping you.

towify commented 4 years ago

@anseki

Thanks for you replying. and I don't know the ignored things? I will check my account settings later.

this is the online demo, you can check it out. just scroll the content, on finished scroll, the draggable elements will auto move into a wrong position. https://jsfiddle.net/ezsdkft9/3/

Thanks you again : )

anseki commented 4 years ago

You ignored my messages many times. Therefore I can't understand your situation. As I said, that is correct behavior of DOM and CSS. See document: https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function You misunderstood transform maybe. That is not a function to zooming-in/out only. That affects the migration length also. For example: https://jsfiddle.net/ue9khnyz/

towify commented 4 years ago

@anseki Yes, you are right, i misunderstood transform, it is not a bug. Thank you very much for your patience.

anseki commented 4 years ago

:smile: