Skip to content

Commit 4d7c4de

Browse files
committed
Fix lasso initiator position when page is scrollable
1 parent b800217 commit 4d7c4de

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/lasso-manager/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const createLasso = (
101101
Math.random().toString(36).substring(2, 5) +
102102
Math.random().toString(36).substring(2, 5);
103103
initiator.id = `lasso-initiator-${id}`;
104-
initiator.style.position = 'absolute';
104+
initiator.style.position = 'fixed';
105105
initiator.style.display = 'flex';
106106
initiator.style.justifyContent = 'center';
107107
initiator.style.alignItems = 'center';
@@ -125,10 +125,7 @@ const createLasso = (
125125
const getMousePosition = (event) => {
126126
const { left, top } = element.getBoundingClientRect();
127127

128-
return [
129-
event.clientX - left,
130-
event.clientY - top,
131-
];
128+
return [event.clientX - left, event.clientY - top];
132129
};
133130

134131
window.addEventListener('mouseup', mouseUpHandler);

0 commit comments

Comments
 (0)