fix:autogrow defaults properly

This commit is contained in:
hackerESQ
2024-10-28 13:07:45 -05:00
parent 28c326a34a
commit 9e6f879d16
@@ -32,16 +32,12 @@
}} }}
x-data="{ x-data="{
resize (rows) { resize (rows) {
if (rows) {
$el.style.height = (rows * 32) + 'px'
return;
}
$el.style.height = '0px'; $el.style.height = '0px';
$el.style.height = $el.scrollHeight + 'px' $el.style.height = ($el.scrollHeight >= rows * 32 ? $el.scrollHeight : rows * 32) + 'px';
} }
}" }"
x-init="resize({{$rows}})" x-init="resize({{$rows}})"
@input="resize()" @input="resize({{$rows}})"
type="text" type="text"
placeholder = "{{ $attributes->whereStartsWith('placeholder')->first() }}" placeholder = "{{ $attributes->whereStartsWith('placeholder')->first() }}"
>{{ $slot }}</textarea> >{{ $slot }}</textarea>