Skip to content

Commit

Permalink
Fix call on undefined property forEach (ampproject#21232)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvializ authored and bramanudom committed Mar 22, 2019
1 parent b4e7826 commit 88ba666
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion extensions/amp-form/0.1/form-validators.js
Expand Up @@ -18,6 +18,7 @@ import {Services} from '../../../src/services';
import {ValidationBubble} from './validation-bubble';
import {createCustomEvent} from '../../../src/event-helper';
import {dev, devAssert} from '../../../src/log';
import {iterateCursor} from '../../../src/dom';
import {toWin} from '../../../src/types';

/** @const @private {string} */
Expand Down Expand Up @@ -171,7 +172,11 @@ export class FormValidator {
* @private
*/
checkTextAreaValidityInForm_(form) {
form.querySelectorAll('textarea').forEach(i => this.checkInputValidity(i));
iterateCursor(form.elements, element => {
if (element.tagName == 'TEXTAREA') {
this.checkInputValidity(element);
}
});
}

/**
Expand Down

0 comments on commit 88ba666

Please sign in to comment.