diff --git a/.Jules/palette.md b/.Jules/palette.md index d6d129bc..a5d2a04d 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -2,3 +2,6 @@ **Learning:** Async buttons that handle errors often fail to reset their error state on subsequent attempts. This leads to a confusing UX where a successful retry still displays the error icon, making the user believe the action failed again. **Action:** Always ensure that error flags (e.g., `hasError`) are reset at the _start_ of the async operation, not just set in the `catch` block. +## 2024-10-25 - Conditionally Rendered Trailing Icons in Textfields +**Learning:** Conditionally rendering just the icon inside a trailing icon slot still leaves the trailing icon button focusable and taking up space when empty. +**Action:** Ensure the entire trailing icon fragment/element is conditionally rendered and the `withTrailingIcon` property is bound to the same condition. diff --git a/src/routes/profile/+page.svelte b/src/routes/profile/+page.svelte index 7f290736..eedb8406 100644 --- a/src/routes/profile/+page.svelte +++ b/src/routes/profile/+page.svelte @@ -17,6 +17,8 @@ $: if (search !== '') { domainsFiltered = domains.filter((domain) => isFuzzyMatch(domain.name, search)); + } else { + domainsFiltered = domains; } walletAddress.subscribe(async (address) => { @@ -55,14 +57,16 @@ label="Search" bind:value={search} variant="outlined" - withTrailingIcon + withTrailingIcon={search !== ''} > -
- - - -
+ {#if search !== ''} +
+ + + +
+ {/if}