- Notifications
You must be signed in to change notification settings - Fork2
Svelte action to automatically adjust textarea height.
License
NotificationsYou must be signed in to change notification settings
jesseskinner/svelte-autosize
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Svelte action to automatically adjust textarea height to match its contents.
Simply wrapsautosize by Jack Moore in a Svelte action.
Seethe autosize website for additional documentation.
npm install svelte-autosize<script>importautosizefrom'svelte-autosize';</script><textareause:autosize></textarea>
If you need to reset the textarea height, you can useautosize.update(textarea). For example:
<script>import{tick}from'svelte';importautosizefrom'svelte-autosize';lettextarea;letvalue='';asyncfunctionreset(){value='';awaittick();autosize.update(textarea);}</script><textareause:autosizebind:this={textarea}bind:value></textarea><buttonon:click={reset}>Reset</button>
About
Svelte action to automatically adjust textarea height.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.