mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-09-14 10:30:50 +02:00
15 lines
415 B
JavaScript
15 lines
415 B
JavaScript
// auto open accordions if there is an invalid item
|
|
document.addEventListener(
|
|
"invalid",
|
|
(e) => {
|
|
const details = e.target.closest("details");
|
|
if (details && !details.open && !e.target.closest("summary")) {
|
|
details.open = true;
|
|
|
|
// revalidate and show the error message
|
|
e.target.reportValidity && e.target.reportValidity();
|
|
}
|
|
},
|
|
true,
|
|
);
|