fix: globe cursor data table resize [DHIS2-19805]#3644
Open
karolinelien wants to merge 2 commits into
Open
Conversation
Contributor
|
🚀 Deployed on https://pr-3644.maps.netlify.dhis2.org |
f7f090e to
d56769e
Compare
|
The empty 1x1 drag image was created and assigned a src inside dragstart, so it was still loading when setDragImage ran. When the supplied image isn't yet `complete`, macOS Chrome falls back to a globe icon as the drag image. Pre-load the image at module scope and guard setDragImage on `.complete` so the real (transparent) image is used. The previous evt.preventDefault() in the dragover handler was orthogonal (it controls drop-acceptance, not the drag image) and is removed. Refs: https://www.sam.today/blog/html5-dnd-globe-icon Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d56769e to
e3fa639
Compare
BRaimbault
approved these changes
May 26, 2026
|
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.



Description
The "globe" isn't actually a cursor — it's the drag image that macOS Chrome falls back to when the image passed to
setDragImage()isn't yetdecoded. The handler created a fresh
<img>and assigned.srcon the dragstart tick, so the image was always still loading whensetDragImage(img, 0, 0)ran.This PR:
setDragImageonEMPTY_DRAG_IMAGE.completeevt.preventDefault()in the dragover handler — that controls drop-acceptance (no-drop vs move cursor), not the drag image,and was orthogonal to this bug
Reference: https://www.sam.today/blog/html5-dnd-globe-icon
Fixes DHIS2-19805
Test plan
Quality checklist
Add N/A to items that are not applicable.
AI Assisted