This commit is contained in:
Elias Mamalias
2024-04-16 07:31:01 +08:00
parent 60afe878a4
commit f4ccbd442b
2 changed files with 11 additions and 4 deletions
@@ -10,5 +10,14 @@ export default function textareaFormComponent({ initialHeight }) {
this.$el.style.height = this.$el.scrollHeight + 'px'
}
},
input: {
['@intersect.once']() { this.render() },
['@input']() { this.render() },
['@resize.window']() { this.render() },
['@form-validation-error.window']() {
this.$nextTick(() => { this.render() })
},
}
}
}
@@ -42,10 +42,8 @@
@endif
ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('textarea', 'filament/forms') }}"
x-data="textareaFormComponent({ initialHeight: @js($initialHeight) })"
x-ignore
x-intersect.once="render()"
x-on:input="render()"
x-on:resize.window="render()"
x-bind="input"
wire:ignore.style.height
{{ $getExtraAlpineAttributeBag() }}
@endif
{{