Merge pull request #804 from Hzunax/fix/fieldset-set-all-values

fix(formgroup): wait for formElements to register
This commit is contained in:
Thijs Louisse 2020-07-09 10:50:49 +02:00 committed by GitHub
commit 68a7cc3d9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,7 +269,10 @@ export const FormGroupMixin = dedupeMixin(
return result;
}
_setValueForAllFormElements(property, value) {
async _setValueForAllFormElements(property, value) {
if (!this.__readyForRegistration) {
await this.registrationReady;
}
this.formElements.forEach(el => {
el[property] = value; // eslint-disable-line no-param-reassign
});