MWPW-194452 Observing Flickering effect while performing drag and drop#216
Open
KetakiD-Deshwandikar wants to merge 1 commit into
Open
MWPW-194452 Observing Flickering effect while performing drag and drop#216KetakiD-Deshwandikar wants to merge 1 commit into
KetakiD-Deshwandikar wants to merge 1 commit into
Conversation
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.
Jira: MWPW-194452
Fixes flicker during drag-and-drop in Editor Preview when inserting Figma blocks into the DA panel and when reordering blocks in the right-hand pane.
Issue
During drag, the drop placeholder was repositioned incorrectly on every pointermove:
Figma → DA drop: When the cursor hovered the placeholder gap, elementFromPoint() found no [data-source] block, so the fallback forced the placeholder to the end of .da-panel and back — causing visible flicker.
Right-pane reorder: The dragged block itself was treated as the insertion target, so the placeholder ping-ponged above/below it as layout shifted under the cursor.
Fix
drag-drop.js: Skip the currently dragged block as an insertion target (targetBlock !== editState.draggedMainBlock). Only append the placeholder when it is not yet in the container; do not force-move it to lastChild on every move.
edit.css: Add pointer-events: none on .da-drop-placeholder so the placeholder does not intercept hit-testing.
Before:
flicker-before_4WB7oKyI.mp4
After:
flicker-fix-after_v2BaDzB3.mp4