fix:autogrow defaults properly
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user