Skip to content

Commit

Permalink
fix: fix editing widget name
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Oct 18, 2024
1 parent 8e30bdb commit b7c4239
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions apps/frontend/src/lib/components/blocks/widget/widget.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@
<Dialog.Header class="border-b p-4" on:dblclick={() => (editing = true)}>
<Dialog.Title>
{#if editing}
<Input class="w-1/2" autofocus on:focus={(e) => e.target.select()} bind:value={widget.name} />
<Input
on:blur={() => {
editing = false
}}
class="w-1/2"
autofocus
on:focus={(e) => e.target.select()}
bind:value={widget.name}
/>
{:else}
{widget.name}
{/if}
Expand All @@ -109,7 +117,15 @@
<div class="flex w-1/4 flex-col border-l px-4 py-2">
<div class="flex-1">
{#if widget.item.type === "aggregate"}
<AggregateConfig {tableId} {viewId} {widget} aggregate={widget.item.aggregate} />
<AggregateConfig
{tableId}
{viewId}
{widget}
aggregate={widget.item.aggregate}
onSuccess={() => {
editing = false
}}
/>
{/if}
</div>
</div>
Expand Down

0 comments on commit b7c4239

Please sign in to comment.