1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2024-11-28 10:03:42 +02:00

[#99] fix AutoExpandTextArea scrolling

This commit is contained in:
Gani Georgiev 2022-07-13 22:44:59 +03:00
parent 9de3cc99a0
commit d4202e696b

View File

@ -1,11 +1,13 @@
<script>
import { onMount } from "svelte";
export let value = "";
export let maxHeight = 200;
let inputElem;
let updateTimeoutId;
$: if (inputElem && typeof value !== undefined) {
$: if (typeof value !== undefined) {
updateInputHeight();
}
@ -32,6 +34,12 @@
form?.requestSubmit && form.requestSubmit();
}
}
onMount(() => {
updateInputHeight();
return () => clearTimeout(updateTimeoutId);
});
</script>
<textarea bind:this={inputElem} bind:value on:keydown={handleKeydown} {...$$restProps} />