Skip to content

fix(drag-drop): keep the ghost under the pointer during window auto-scroll - #18026

Open
damyanpetev wants to merge 1 commit into
dpetev/vitest-coverage-testsfrom
dpetev/drag-ghost-scroll-drift
Open

damyanpetev wants to merge 1 commit into
dpetev/vitest-coverage-testsfrom
dpetev/drag-ghost-scroll-drift

Conversation

@damyanpetev

Copy link
Copy Markdown
Member

Stacked on #18024, which adds the igxDrag window auto-scroll tests this extends.

While igxDrag auto-scrolls the window with the pointer held still near the viewport edge, a ghost with a margin drifts away from the pointer. It moves up and left by its margin on every scroll step, so a ghost with margin: 10px is 50px off within a few steps. The next pointer move snaps it back.

Each scroll step moves the ghost with ghostTop += scrollByY. The ghostLeft/ghostTop setters take a page position that includes the margin and subtract it before writing style.left/style.top, but the getters returned the style value without adding it back. Every read-and-write cycle lost the margin.

The getters now add the margin back, so they return the position the setters take. This also changes location for a ghost with a margin. It now reports the same position setLocation() takes, consistent with location without a ghost. Before, it was off by the margin.

🤖 Generated with Claude Code

…croll

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant