Skip to content

mouse drag out of sync with div scale #1275

Closed

Description

@hzjux001

When I change the target div's SCALE, just like "transform: scale(0.457292) translate(0px, 0px);",the movement or dragging in the gridstack is out of sync with the real mouse movement

Activity

  1. adumesny commented on May 14, 2020

    @adumesny
    Member

    you need to create a reproduceable test case if you want us to take a look. look at the jsfiddle template

  2. hzjux001 commented on May 14, 2020

    @hzjux001
    Author

    Because In many cases we need to zoom the page,
    in the example https://gridstackjs.com/demo/advance.html,
    I change the style in grid-stack div
    just like
    <div class="grid-stack grid-stack-instance-9799 grid-stack-animate ui-droppable" data-gs-animate="yes" data-gs-current-row="6" style="height: 460px;transform: scale(0.7, 0.7) translate(0px, 0px);">
    and when we drag or resize by mouse,
    the movement or dragging in the gridstack is out of sync with the real mouse movement

  3. hzjux001 commented on May 14, 2020

    @hzjux001
    Author

    The same is true even if you put the zoom style on the outer DIV
    just like
    <div style="width:100%;height:100%;transform: scale(0.7, 0.7) translate(0px, 0px);>
    <div class="grid-stack grid-stack-instance-9799 grid-stack-animate ui-droppable" data-gs-animate="yes" data-gs-current-row="6" >...</div>
    </div>

  4. changed the title [-]when change the target div's scale,[/-] [+]mouse drag out of sync with div scale[/+] on May 14, 2020
  5. hzjux001 commented on May 22, 2020

    @hzjux001
    Author

    Who can help me solve this problem,Please.

  6. adumesny commented on May 22, 2020

    @adumesny
    Member

    browser zooming works just fine, so not sure why you would manually scale the div in code...

    if you are such in need of a fix, and don't want to fix it yourself, maybe you should consider donating $ to this effort.

  7. hzjux001 commented on May 26, 2020

    @hzjux001
    Author

    How can I donate

  8. adumesny commented on May 26, 2020

    @adumesny
    Member

    github page and website has donate links https://github.com/gridstack/gridstack.js

  9. vishaldodiya commented on Nov 13, 2020

    @vishaldodiya

    @adumesny Is there any workaround for this? Like we can calculate position according to scale and pass it to gridstack.

  10. adumesny commented on Dec 5, 2020

    @adumesny
    Member

    unlikely to get fixed as not a priority or support and I don't understand the use case why you would scale a div (so many things break when scaling in my experience).

    HTML5 drag&drop is a lot worse than the JQ version which seems only off by scale factor relative to parent (0,0)

  11. added a commit that references this issue on Sep 30, 2023
  12. adumesny commented on Sep 30, 2023

    @adumesny
    Member

    fixed in next release.

  13. added a commit that references this issue on Oct 21, 2023
    5a44c8c
  14. adumesny commented on Oct 22, 2023

    @adumesny
    Member

    will be in next 9.5 relase.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions