Fix block Delete buttons painting over the "Add block" menu

The Delete label in each block row is `relative z-10` (to sit above its
hold-to-delete fill) — the same z-index as the dropdown, and later in the
DOM, so it painted on top of the open menu. Each row is now `isolate`
(its z-indexed layers stay inside it) and the dropdowns in the page and
email editors sit at z-20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
This commit is contained in:
agent 2026-10-06 11:32:21 +00:00
parent c54da8728e
commit 015ce2a63f
2 changed files with 4 additions and 2 deletions

View file

@ -49,10 +49,12 @@
} }
</script> </script>
<!-- `isolate` on each row: the delete button's z-indexed layers must stay
inside their row, or they paint over dropdowns like "Add block". -->
<ul class="space-y-2"> <ul class="space-y-2">
{#each blocks as block, i (block.id)} {#each blocks as block, i (block.id)}
<li <li
class="flex items-center gap-2 rounded-box border bg-base-100 p-2 pl-3 shadow-sm transition-colors {selectedId === block.id ? 'border-primary ring-1 ring-primary' : 'border-base-300 hover:border-base-content/30'}" class="isolate flex items-center gap-2 rounded-box border bg-base-100 p-2 pl-3 shadow-sm transition-colors {selectedId === block.id ? 'border-primary ring-1 ring-primary' : 'border-base-300 hover:border-base-content/30'}"
class:opacity-50={dragIndex === i} class:opacity-50={dragIndex === i}
class:border-dashed={dropIndex === i && dragIndex !== i} class:border-dashed={dropIndex === i && dragIndex !== i}
draggable="true" draggable="true"

View file

@ -126,7 +126,7 @@
<div class="rounded-box bg-base-100 p-4 shadow"> <div class="rounded-box bg-base-100 p-4 shadow">
<div class="dropdown w-full"> <div class="dropdown w-full">
<button class="btn btn-primary w-full" type="button" tabindex="0">Add block</button> <button class="btn btn-primary w-full" type="button" tabindex="0">Add block</button>
<ul class="menu dropdown-content z-10 mt-2 w-full rounded-box bg-base-100 p-2 shadow"> <ul class="menu dropdown-content z-20 mt-2 w-full rounded-box bg-base-100 p-2 shadow-lg">
{#each blockTypes as type} {#each blockTypes as type}
<li><button type="button" onclick={() => addBlock(type)}>{blockLabels[type]}</button></li> <li><button type="button" onclick={() => addBlock(type)}>{blockLabels[type]}</button></li>
{/each} {/each}