{ // Escape and click-away close the drawer before asking. Reopening in the same tick is // how the flow's script editor drawer handles this too: the close transition has not // started, so nothing flickers. if (saving) { drawer?.openDrawer() return } if (!discarding && unsaved) { drawer?.openDrawer() confirmDiscardOpen = true } }} >
{#key instance} (canSave = v)} onUnsavedChange={(v) => (unsaved = v)} onExistsChange={(v) => (exists = v)} /> {/key}
{#snippet actions()} {/snippet}
(confirmDiscardOpen = false)} onConfirmed={() => { confirmDiscardOpen = false discarding = true drawer?.closeDrawer() }} > Are you sure you want to discard the changes you have made to this group?