Fixes #109 - ensure sl-form finds all nested controls

This commit is contained in:
Chris Haynes
2020-07-18 22:56:18 +01:00
parent aaf0f9f69e
commit 5709d993ef

View File

@@ -184,6 +184,7 @@ export class Form {
const tags = this.formControls.map(control => control.tag);
return slot
.assignedElements({ flatten: true })
.reduce((all, el) => all.concat(el, [...el.querySelectorAll('*')]), [])
.filter(el => tags.includes(el.tagName.toLowerCase())) as HTMLElement[];
}