Browse Source

fix(admin-ui): Fix positioning of file dropzone overlay

Michael Bromley 7 years ago
parent
commit
465b2c66d7

+ 1 - 1
admin-ui/src/app/catalog/components/asset-file-input/asset-file-input.component.scss

@@ -5,7 +5,7 @@
 }
 
 .drop-zone {
-    position: absolute;
+    position: fixed;
     background-color: transparentize($color-brand, 0.7);
     border: 3px dashed $color-grey-4;
     opacity: 0;

+ 2 - 2
admin-ui/src/app/catalog/components/asset-file-input/asset-file-input.component.ts

@@ -82,8 +82,8 @@ export class AssetFileInputComponent implements OnInit {
             const rect = target.getBoundingClientRect();
             this.dropZoneStyle['width.px'] = rect.width;
             this.dropZoneStyle['height.px'] = rect.height;
-            this.dropZoneStyle['top.px'] = target.offsetTop;
-            this.dropZoneStyle['left.px'] = target.offsetLeft;
+            this.dropZoneStyle['top.px'] = rect.top;
+            this.dropZoneStyle['left.px'] = rect.left;
         }
     }
 }