fix(ui): modal drag + removed startDrag func (#2430)

* fixed

* removed legacy startDrag fc, unified modal dragging

* fixes post feedback
This commit is contained in:
Alex Little
2026-06-04 19:34:18 +01:00
committed by GitHub
parent ab5311c44d
commit 33425a9c6c
3 changed files with 40 additions and 76 deletions
+7
View File
@@ -149,6 +149,13 @@ export function makeWindowDraggable(modal, options = {}) {
const _startDrag = (cx, cy) => {
dragging = true;
if (modal) modal.classList.add('modal-dragging');
// Cancel any in-flight open animation so we don't pin a mid-animation
// rect and then jump once the animation settles.
try {
content.getAnimations()
.filter(a => a.playState !== 'finished')
.forEach(a => a.cancel());
} catch (_) {}
const rect = content.getBoundingClientRect();
if (onDragStart) {
try { onDragStart({ rect, cx, cy }); } catch (_) {}