dnd-multi-backend
dnd-multi-backend copied to clipboard
calculatePointerPosition should respect zoom level on iPhone
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.
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 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:
- Search for an album ("Abbey Road")
- Pinch to zoom in
- Begin dragging the Abbey Road album cover
- 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.
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?