kutlugsahin / ngx-smooth-dnd

angular wrapper for smooth-dnd
165 stars 30 forks source link

Scale on iOS devices #2

Open falget opened 6 years ago

falget commented 6 years ago

Hello, i found some bug, when i scale screen and start draging item his position is wrong. Item display not the same position where i touch. Reproduced only on iOS devices, on Android devices work correctly.

Sorry but i can't attach screenshot or video.

kutlugsahin commented 6 years ago

Hi @falget , I don't have ios device to test and debug right now but do you know if there is a ios safari specific event that is fired when you 'scale'. I assume you mean pinch zoom by scaling right? If so it may be enough to handle ongestureend event for ios

falget commented 6 years ago

@kutlugsahin Yes i mean pinch zoom, i tried to fix this problem by disable scaling on page, but on iOS i can't do this totally. To check scaling i tried to use next events:

@HostListener('document:gesturestart', ['$event']) @HostListener('document:gesturechange', ['$event']) @HostListener('document:touchstart', ['$event']) @HostListener('document:touchmove', ['$event']) onScale(event: any) { event = event.originalEvent || event; if (event.scale !== 1) { event.preventDefault(); } }

I'm not sure but i think, when dragging need to somehow calculate the position in a different way taking into account the zoom.

kutlugsahin commented 6 years ago

Thanks @falget! I need to invalidate the layout calculations after this specific event. Probably will be fixed in the next version.

falget commented 6 years ago

@kutlugsahin Ok, thank you, will be wait.