Set root $el as mirror container (instead of document.body) #54
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.
Hi,
this PR uses the kanban-board itself as container for the mirrored cards. By default, dragula uses document.body (which is sensible because it requires no knowledge about the DOM structure) but Vue gives us access to the DOM element that the component is mounted on, via $el. The benefit of using $el is that the original blocks/cards and the mirrored blocks/cards are closer to each other in the DOM and CSS rules are more likely to work for originals and mirrors alike (whereas all nested CSS rules for the original cards will fail for the mirrors when attached to document.body). This makes it much easier to style the mirrors in a similar/same way as the originals, with one set of CSS rules.