From 890fdf2a620e49b462c8d2854e93c061f889138f Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Mon, 10 Jun 2024 20:56:47 +0300 Subject: [PATCH] add a fix on error to expand the accordion --- resources/views/components/accordion/item.blade.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/views/components/accordion/item.blade.php b/resources/views/components/accordion/item.blade.php index d934de2..590ec35 100644 --- a/resources/views/components/accordion/item.blade.php +++ b/resources/views/components/accordion/item.blade.php @@ -11,6 +11,18 @@ id: $id('accordion'), @if($isIsolated) activeAccordion: 'accordion-{{ $activeAccordion }}', @endif }" + + :x-on:form-validation-error.window=" + $nextTick(() => { + let error = $el.querySelector('[data-validation-error]'); + + if (! error) { + return + } + + setActiveAccordion($id('accordion')); + }) + " class="fi-accordion-item group" >