mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 20:39:03 +00:00
Fix EditBox keep same width if control is reused with different props (#578)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
a55b475d6f
commit
6f41a078da
@ -14,7 +14,7 @@
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte'
|
||||
import { createEventDispatcher, onMount, afterUpdate } from 'svelte'
|
||||
import type { IntlString, Asset } from '@anticrm/platform'
|
||||
import type { AnySvelteComponent } from '../types'
|
||||
import Label from './Label.svelte'
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
$: style = maxWidth ? `max-width: ${maxWidth};` : ''
|
||||
|
||||
function computeSize(t: EventTarget | null) {
|
||||
function computeSize (t: EventTarget | null) {
|
||||
const target = t as HTMLInputElement
|
||||
const value = target.value
|
||||
text.innerHTML = (value === '' ? placeholder : value).replaceAll(' ', ' ')
|
||||
@ -51,6 +51,12 @@
|
||||
}
|
||||
computeSize(input)
|
||||
})
|
||||
|
||||
afterUpdate(() => {
|
||||
computeSize(input)
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<div class="container" on:click={() => { input.focus() }}>
|
||||
|
Loading…
Reference in New Issue
Block a user