mirror of
https://github.com/pocketbase/pocketbase.git
synced 2024-11-24 17:07:00 +02:00
[#99] fix AutoExpandTextArea scrolling
This commit is contained in:
parent
9de3cc99a0
commit
d4202e696b
@ -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} />
|
||||
|
Loading…
Reference in New Issue
Block a user