Migrate to svelte 5
This commit is contained in:
@@ -3,10 +3,14 @@
|
||||
import { DataBase } from "../../../ts/storage/database";
|
||||
import { longpress } from 'src/ts/gui/longtouch';
|
||||
|
||||
let textarea;
|
||||
let textarea:HTMLElement = $state();
|
||||
let previousScrollHeight = 0;
|
||||
export let value = ''
|
||||
export let handleLongPress = (e:MouseEvent) => {};
|
||||
interface Props {
|
||||
value?: string;
|
||||
handleLongPress?: any;
|
||||
}
|
||||
|
||||
let { value = $bindable(''), handleLongPress = (e:MouseEvent) => {} }: Props = $props();
|
||||
|
||||
function resize() {
|
||||
textarea.style.height = '0px'; // Reset the textarea height
|
||||
@@ -27,10 +31,10 @@
|
||||
|
||||
<textarea
|
||||
bind:this={textarea}
|
||||
on:input={handleInput}
|
||||
oninput={handleInput}
|
||||
use:longpress={handleLongPress}
|
||||
bind:value={value}
|
||||
class="rounded-md p-2 text-textcolor bg-transparent resize-none overflow-y-hidden border border-darkborderc"
|
||||
style:font-size="{0.875 * ($DataBase.zoomsize / 100)}rem"
|
||||
style:line-height="{($DataBase.lineHeight ?? 1.25) * ($DataBase.zoomsize / 100)}rem"
|
||||
/>
|
||||
></textarea>
|
||||
Reference in New Issue
Block a user