Skip to content

Commit 1ce1db9

Browse files
authored
Merge pull request #11 from lara-zeus/on-error
add a fix on error to expand the accordion
2 parents 125a0aa + 890fdf2 commit 1ce1db9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

resources/views/components/accordion/item.blade.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111
id: $id('accordion'),
1212
@if($isIsolated) activeAccordion: 'accordion-{{ $activeAccordion }}', @endif
1313
}"
14+
15+
:x-on:form-validation-error.window="
16+
$nextTick(() => {
17+
let error = $el.querySelector('[data-validation-error]');
18+
19+
if (! error) {
20+
return
21+
}
22+
23+
setActiveAccordion($id('accordion'));
24+
})
25+
"
1426
class="fi-accordion-item group"
1527
>
1628
<button

0 commit comments

Comments
 (0)