From 362db1238f64e30b3eb3cc1a7bb5c7c967388fe2 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 13 Dec 2025 22:14:32 -0800 Subject: [PATCH] fix input focus loss when error state changes always wrap in fieldset to keep DOM structure stable --- src/lib/components/ui/Input.svelte | 139 +++++++++-------------------- 1 file changed, 40 insertions(+), 99 deletions(-) diff --git a/src/lib/components/ui/Input.svelte b/src/lib/components/ui/Input.svelte index 2e5ae9fe..1bccea5a 100644 --- a/src/lib/components/ui/Input.svelte +++ b/src/lib/components/ui/Input.svelte @@ -99,62 +99,26 @@ }) -{#if label || error} -
- {#if label} - - {label} - {#if required} - * - {/if} - - {/if} +
+ {#if label} + + {label} + {#if required} + * + {/if} + + {/if} - {#if hasWrapper} -
- {#if leftIcon} - - - - {/if} + {#if hasWrapper} +
+ {#if leftIcon} + + + + {/if} - - - {#if rightIcon} - - - - {/if} - - {#if validationIcon} - - - - {/if} - - {#if showCounter} - - {charsRemaining !== undefined ? charsRemaining : currentCount} - - {/if} -
- {:else} - {/if} - {#if error} - {error} - {/if} -
-{:else if hasWrapper} -
- {#if leftIcon} - - - - {/if} + {#if rightIcon} + + + + {/if} + {#if validationIcon} + + + + {/if} + + {#if showCounter} + + {charsRemaining !== undefined ? charsRemaining : currentCount} + + {/if} +
+ {:else} + {/if} - {#if rightIcon} - - - - {/if} - - {#if validationIcon} - - - - {/if} - - {#if showCounter} - - {charsRemaining !== undefined ? charsRemaining : currentCount} - - {/if} - -{:else} - -{/if} + {#if error} + {error} + {/if} +