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

Quirks after zooming a page (even in the docs) #142

Closed kkarpeev closed 1 year ago

kkarpeev commented 1 year ago

Hello! Caught some disturbing quirks. It seems that p-d can't work correctly after zooming the page.

You can reproduce it here (Firefox or Chrome): click

1) Scroll down to USAGE header and go up a little. There are the examples. 2) Ctrl + scrollUp or Ctrl + Num+ to zoom (better to press it a couple of times). 3) Try to drag elements in examples of (1). Try to drag items in sortable list example. Some constraints cease to work, some elements disappear on drop and so on...

image

Can you fix it, please?

anseki commented 1 year ago

Hi @kkarpeev, thank you for the comment. This may help you: https://github.com/anseki/plain-draggable/issues?q=is%3Aissue+scale You can adjust that by using onDrag.

kkarpeev commented 1 year ago

Sorry, but adjust what exactly? And why don't you adjust it in your docs yourself? Code there isn't mine. And I'm trying to point to you that the code in your examples isn't working properly, it needs to be fixed.
Sorry again for being straightforward. But are you going to fix it or not?

anseki commented 1 year ago

Yes, I updated that. Thank you for the report. 😄 That was changed for touch devices, other editions are not the target because it's meaningless and unnecessary. Thank you.

kkarpeev commented 1 year ago

There is nothing to thank me, actually. You just forbid the kb shortcuts for zoom. That didn't solve a thing, browser zoom still works, the examples are still glitchy. You just hid the problem from people. Great job. But if this approach is okay for you, I'm not gonna waste time (mine and yours) here anymore. I really tried to be nice. Good luck!

image

P.S. The simplest zoom detector, btw.

anseki commented 1 year ago

Yes, of course mouse and keyboard are not the target. And also, the root cause is not those events as it was already mentioned in past issues. Thank you for your opinion 😄