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="{
resize (rows) {
if (rows) {
$el.style.height = (rows * 32) + 'px'
return;
}
$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}})"
@input="resize()"
@input="resize({{$rows}})"
type="text"
placeholder = "{{ $attributes->whereStartsWith('placeholder')->first() }}"
>{{ $slot }}</textarea>