Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Feature/prevent ui flicker on dragstart #379

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nathanbedford
Copy link

@nathanbedford nathanbedford commented Jan 28, 2017

If you use a drag and drop method that has the dndDraggingSource class removing the dragging source (such as this demo http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/nested) you might notice that, on old browsers, you'll see a flicker on drag start. In my own testing the list had to be 10+ items to notice it.

What we're seeing is the removal of the source item from the visible DOM (when 'dndDraggingSource' is applied) in one tick, and then the placeholder being added to the list in a future tick.

This PR changes makes it so as long as the item is in a dnd-list, the 'dndDraggingSource' class isn't applied until the placeholder is inserted, thus eliminating the UI flicker.

FYI this is especially noticeable on mobile devices.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant