dnd-multi-backend icon indicating copy to clipboard operation
dnd-multi-backend copied to clipboard

calculatePointerPosition should respect zoom level on iPhone

Open ColemanGariety opened this issue 3 years ago • 3 comments

calculatePointerPosition does not take into account the zoom level. So previews are offset on iPhone, if the user is zoomed in. The function should detect the zoom level and adjust the coordinates appropriately.

ColemanGariety avatar Jun 08 '22 09:06 ColemanGariety

Hi @JacksonGariety,

I can't seem to reproduce it with different zoom level on any device, are you using the ref prop of the Preview component? https://github.com/LouisBrunner/dnd-multi-backend/tree/main/packages/react-dnd-preview#usage--example

LouisBrunner avatar Aug 31 '22 16:08 LouisBrunner

@LouisBrunner I am not using the ref property. I'll try it and see if that fixes it.

The bug is visible on the mobile version of this web app: https://www.neverendingchartrendering.org/

Steps to repro:

  1. Search for an album ("Abbey Road")
  2. Pinch to zoom in
  3. Begin dragging the Abbey Road album cover
  4. Note that more you zoom in, the more offset the preview is.

UPDATE: I added the ref property but it didn't affect the position of the preview at all.

ColemanGariety avatar Oct 10 '22 16:10 ColemanGariety

Hey @JacksonGariety,

I tried it but couldn't reproduce it. Did you find a find an alternative way to get it working? Can you show me an example of how you use the ref property?

LouisBrunner avatar Dec 10 '22 17:12 LouisBrunner