this.content = elem.querySelector('[collapsible-content]');
if (!this.trigger) return;
-
this.trigger.addEventListener('click', this.toggle.bind(this));
+ this.openIfContainsError();
}
open() {
}
}
+ openIfContainsError() {
+ const error = this.content.querySelector('.text-neg.text-small');
+ if (error) {
+ this.open();
+ }
+ }
+
}
export default Collapsible;
\ No newline at end of file