Reset .card-columns vertical scroll on drag end (#2964) - #3004
Open
JoeJoeflyn wants to merge 1 commit into
Open
Conversation
After dragging a card, empty columns' "Drag cards here" drop zones can peek out at the bottom of the board and push the column headings up, leaving the board stuck until a full page refresh (basecamp#2964). .card-columns is overflow-y: hidden, so it is never meant to scroll vertically. But empty columns' blank-slate placeholders hang past its bottom edge (clipped by the hidden overflow), and the container is still scrollable by browser-internal scrolling such as drag auto-scroll, which some Chrome/Edge builds trigger. Once scrollTop is offset it is never reset, so the clipped slates become visible and the board is stuck. Pin scrollTop back to zero in dragEnd. Since overflow-y: hidden means there is never a legitimate vertical scroll, this is always safe and unsticks the board regardless of what offset it. Closes basecamp#2964.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an environment-specific board “stuck” state after drag-and-drop by forcibly resetting vertical scroll on the .card-columns container at the end of a drag. This hardens the drag lifecycle against browser-internal/programmatic vertical scrolling, which is not a supported interaction because the container is overflow-y: hidden.
Changes:
- Reset
scrollTopto0indragEndto prevent empty-column drop zones from peeking out and shifting headings after a drag. - Document the rationale inline, tying the behavior to
overflow-y: hiddenand issue #2964.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After dragging a card, empty columns' "Drag cards here" drop zones can peek out at the bottom and push the column headings up, leaving the board stuck until a full page refresh (#2964).
Root cause
.card-columnsisoverflow-y: hiddenbut still a scroll container. Empty columns' blank-slate placeholders hang past its bottom edge (clipped by the hidden overflow), and browser-internal scrolling (e.g. drag auto-scroll on some Chrome/Edge builds) can offsetscrollTop, which is never reset.Fix
Reset
scrollTopto0indragEnd. There is never a legitimate vertical scroll, so this is always safe.Testing
Verified on the dev board: after a drag,
document.querySelector(".card-columns").scrollTopis0. Forcing the stuck state (scrollTop = 9999) then dragging any card snaps it back and unsticks the board.Closes #2964.
screenrecording-2026-07-28_20-42-56.mp4