From f3c034bdc1c7c822ef767f02f79c5bea3b38facb Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Fri, 27 Aug 2021 14:40:29 +0300 Subject: [PATCH] Wrapped input (#71) Signed-off-by: Alexander Platov --- packages/ui/src/components/EditBox.svelte | 47 ++++++++++++++----- packages/ui/src/components/Popup.svelte | 2 + .../src/components/DialogHeader.svelte | 2 +- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/packages/ui/src/components/EditBox.svelte b/packages/ui/src/components/EditBox.svelte index 3334c6cff3..9e35e8771a 100644 --- a/packages/ui/src/components/EditBox.svelte +++ b/packages/ui/src/components/EditBox.svelte @@ -32,7 +32,7 @@ const target = t as HTMLInputElement const value = target.value text.innerHTML = (value === '' ? placeholder : value).replaceAll(' ', ' ') - target.style.width = text.clientWidth + 8 + 'px' + target.style.width = text.clientWidth + 'px' } onMount(() => { @@ -49,17 +49,42 @@ >
{#if label}
{/if} - {#if password} - ev.target && computeSize(ev.target)} /> - {:else} - ev.target && computeSize(ev.target)} /> - {/if} +
+ {#if password} + ev.target && computeSize(ev.target)} /> + {:else} + ev.target && computeSize(ev.target)} /> + {/if} +