Skip to content

Commit

Permalink
fix: do not fallback background color to white for customised preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Apr 24, 2018
1 parent 086df93 commit c1e8b82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/dnd-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,9 @@ export class DndService {
if (this._preview) return;
if (this._noPreview) return;

if (this._sourcePreview) {
let customised = !!this._sourcePreview;

if (customised) {
this._preview = this._sourcePreview;
this._sourcePreview = undefined;
} else {
Expand All @@ -722,7 +724,7 @@ export class DndService {
doc.body.appendChild(this._preview);
classes.add(doc.body, 'bcx-dnd-unselectable');

if (_global.getComputedStyle(this._preview).backgroundColor === 'rgba(0, 0, 0, 0)') {
if (customised && _global.getComputedStyle(this._preview).backgroundColor === 'rgba(0, 0, 0, 0)') {
this._preview.style.backgroundColor = 'white';
}

Expand Down

0 comments on commit c1e8b82

Please sign in to comment.