fix onSelect and onChange are both wired to handleSelect, causing it to be called twice per user selection.

This commit is contained in:
Harsh Mahajan
2026-02-20 14:57:13 +05:30
parent affe37f0b7
commit 0079071eae
2 changed files with 7 additions and 12 deletions
@@ -140,16 +140,14 @@
{#if variant === 'cname' && !subdomain}
{#if isCloud}
<Alert.Inline>
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain,
CNAME record is only supported by certain providers. If yours doesn't, please verify
using
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain, CNAME
record is only supported by certain providers. If yours doesn't, please verify using
<Link variant="muted" on:click={onNavigateToNameservers}>nameservers</Link> instead.
</Alert.Inline>
{:else if aTabVisible || aaaaTabVisible}
<Alert.Inline>
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain,
CNAME record is only supported by certain providers. If yours doesn't, please verify
using
Since <Badge variant="secondary" size="s" content={domain} /> is an apex domain, CNAME
record is only supported by certain providers. If yours doesn't, please verify using
{#if aTabVisible}
<Link variant="muted" on:click={onNavigateToA}>A record</Link>
{#if aaaaTabVisible}
@@ -376,10 +376,8 @@
}
});
async function handleSelect(detail: { fullPath: string }) {
const path = detail.fullPath as string;
currentPath = path;
loadPath(path);
function handleSelect(detail: { fullPath: string }) {
loadPath(detail.fullPath);
}
function handleSubmit() {
@@ -398,8 +396,7 @@
expanded={expandedStore}
bind:selected={currentPath}
openTo={initialPath}
onSelect={handleSelect}
onChange={handleSelect} />
onSelect={handleSelect} />
<svelte:fragment slot="footer">
<Button secondary on:click={() => (show = false)}>Cancel</Button>