fixed z-index ordering issues

This commit is contained in:
peterkogo
2025-04-16 16:02:22 +02:00
parent 3ef63ad10e
commit 201ed30bc6
15 changed files with 290 additions and 202 deletions
@@ -22,6 +22,10 @@
const store = useStore();
const id = getContext<string>('svelteflow__edge_id');
let z = $derived.by(() => {
return store.visible.edges.get(id)?.zIndex;
});
</script>
<div
@@ -32,6 +36,7 @@
style:pointer-events="all"
style:width={toPxString(width)}
style:height={toPxString(height)}
style:z-index={z}
role="button"
tabindex="-1"
onclick={() => {
@@ -95,7 +95,6 @@
edgeRef?.blur();
unselectNodesAndEdges({ edges: [edge] });
} else {
console.log(id);
addSelectedEdges([id]);
}
}
@@ -103,8 +102,9 @@
</script>
<!-- TODO: aria-label, describedby -->
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
{#if !hidden}
<svg style:z-index={zIndex}>
<svg style:z-index={zIndex} class="svelte-flow__edge-wrapper">
<g
bind:this={edgeRef}
class={['svelte-flow__edge', className]}
@@ -135,7 +135,7 @@
: `Edge from ${source} to ${target}`}
role={focusable ? 'button' : 'img'}
onkeydown={focusable ? onkeydown : undefined}
tabIndex={focusable ? 0 : undefined}
tabindex={focusable ? 0 : undefined}
>
<EdgeComponent
{id}
@@ -46,7 +46,6 @@
}
function onkeydown(event: KeyboardEvent) {
console.log('yas');
if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {
event.preventDefault();
store.moveSelectedNodes(arrowKeyDiffs[event.key], event.shiftKey ? 4 : 1);