techniq / svelte-ux

Collection of Svelte components, actions, stores, and utilities to build highly interactive applications.
https://svelte-ux.techniq.dev/
MIT License
663 stars 33 forks source link

TextField action autosize does not work with bind #422

Closed michalss closed 1 week ago

michalss commented 2 weeks ago

Hi autosize does not work with bind:value. Can you please help me out how to make TextField autosize when i do bind value ?

<TextField
  label="Text Translated"
  multiline
  name="textTranslated"
  bind:value={selectedItem.text_translated}
     actions={(node) => {
    // @ts-expect-error
    return [autoHeight(node)];
  }}
 />
michalss commented 2 weeks ago

or at least how to make it static height ?

techniq commented 1 week ago

Hey @michalss 👋

I just tested and couldn't reproduce the bind:value issue you are experiencing, and updated the autoheight example.

To set a static height, you can pass classes to the underlying input, such as:

<TextField multiline classes={{ input: 'h-[100px]' }} />

I've also added this as an example.