Fixed FileDropArea in Drive (#5993)

Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
Alexander Platov 2024-07-03 17:23:10 +03:00 committed by GitHub
parent 15d9661f29
commit 6756c43e4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 21 deletions

View File

@ -71,34 +71,29 @@
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="dropzone h-full"
class="dropzone flex-col w-full h-full"
class:dragover
on:dragenter={handleDragEnter}
on:dragleave={handleDragLeave}
on:dragover|preventDefault={handleDragOver}
on:drop={handleDrop}
>
{#if dragover}
<div class="dropzone-overlay" />
{/if}
<slot />
</div>
<style lang="scss">
.dropzone {
position: relative;
}
.dropzone-overlay {
pointer-events: none;
z-index: 1;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: var(--primary-button-transparent);
border: 2px dashed var(--primary-button-outline);
&::after {
position: absolute;
inset: 0;
background-color: var(--primary-button-transparent);
border: 2px dashed var(--primary-button-outline);
pointer-events: none;
}
&.dragover::after {
content: '';
}
}
</style>

View File

@ -69,11 +69,11 @@
<FilterBar {_class} {space} query={searchQuery} {viewOptions} on:change={(e) => (resultQuery = e.detail)} />
<div class="popupPanel rowContent" on:contextmenu>
{#if viewlet}
<Scroller horizontal={true}>
<FileDropArea {space} {parent} canDrop={() => !readonly}>
<FileDropArea {space} {parent} canDrop={() => !readonly}>
<Scroller horizontal={true}>
<ViewletContentView {_class} {viewlet} query={resultQuery} {space} {viewOptions} />
</FileDropArea>
</Scroller>
</Scroller>
</FileDropArea>
{/if}
</div>
{/if}