daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.08k stars 618 forks source link

Snaplines renders in the wrong place for a position fixed element and scrollTop != 0 #791

Closed mhaidamashko closed 1 year ago

mhaidamashko commented 1 year ago

Environments

Description

I want to position my target as fixed and use a common transform, it works fine until the page is in the highest position(scrollTop = 0) in other scenarios I have guidelines in the wrong position. Do you know how I can manage it? screencast 2022-11-11 16-39-17 Thanks for your work!

daybrush commented 1 year ago

@mhaidamashko

Use refresh option

elementGuidelines: [{
    element: document.getElementById("box1"),
    refresh: true,
}],
mhaidamashko commented 1 year ago

@daybrush you're right, that's exactly what I need for the elementGuidelines case. However what to do with horizontalGuidelines/verticalGuidelines that are still rendered in the wrong place? Do I have refresh property for them?

Updated example with a refresh option: https://codesandbox.io/s/boring-glade-gn9644?file=/src/index.js:400-418

daybrush commented 1 year ago

@mhaidamashko

moveable's new version is released. Check it again.

mhaidamashko commented 1 year ago

@daybrush Thanks, I've checked it with the new version and the issue is still partly here. Vertical guidelines still follow the scroll(but horizontal is fixed). https://codesandbox.io/s/strange-browser-puu0i9?file=/src/index.js Could you check again, please? screencast 2022-11-15 12-54-44

daybrush commented 1 year ago

@mhaidamashko

moveable's new version is released. Check it again.

mhaidamashko commented 1 year ago

@daybrush thanks, it works great!