fix: tabs can now be moved within apps

This commit is contained in:
Ruben Fiszel
2024-03-13 19:27:37 +01:00
parent 0d77f7e414
commit 696b69b7a1
2 changed files with 16 additions and 14 deletions
@@ -4,7 +4,6 @@
import { createEventDispatcher } from 'svelte'
import type { InputType, StaticInput, StaticOptions } from '../../inputType'
import SubTypeEditor from './SubTypeEditor.svelte'
import { flip } from 'svelte/animate'
import { dndzone, SOURCES, TRIGGERS } from 'svelte-dnd-action'
import { generateRandomString, pluralize } from '$lib/utils'
import Toggle from '$lib/components/Toggle.svelte'
@@ -280,7 +279,7 @@
on:finalize={handleFinalize}
>
{#each items as item, index (item.id)}
<div animate:flip={{ duration: flipDurationMs }} class="border-0 outline-none w-full">
<div class="border-0 outline-none w-full">
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<div class="flex flex-row gap-2 items-center relative my-1 w-full">
@@ -181,21 +181,24 @@
<CloseButton noBg on:close={() => deleteSubgrid(index)} />
</div>
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<div class="flex flex-col justify-center gap-2">
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
tabindex={dragDisabled ? 0 : -1}
class="w-4 h-4"
on:mousedown={startDrag}
on:touchstart={startDrag}
on:keydown={handleKeyDown}
aria-label="drag-handle"
style={dragDisabled ? 'cursor: grab' : 'cursor: grabbing'}
>
<GripVertical size={16} />
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
tabindex={dragDisabled ? 0 : -1}
class="w-4 h-4"
on:mousedown={startDrag}
on:touchstart={startDrag}
on:keydown={handleKeyDown}
aria-label="drag-handle"
style={dragDisabled ? 'cursor: grab' : 'cursor: grabbing'}
>
<GripVertical size={16} />
</div>
</div>
</div>
{#if canDisableTabs && disabledTabs}
<GridTabDisabled bind:field={disabledTabs[index]} id={component.id} />
{/if}