Added code to only validate elements that are currently visible.

This commit is contained in:
MattMo 2022-03-06 21:16:59 -08:00
parent 1b30a8cfdd
commit 7f68337626

View File

@ -326,6 +326,11 @@ HTMLElement.prototype.validate = function () {
for (var i = 0; i < elements.length; i++) { for (var i = 0; i < elements.length; i++) {
var element = elements[i]; var element = elements[i];
//Check if the element is visible.
if (!element.offsetParent) {
continue;
}
//If this element has a template, and has validators, run them, if any are false, return false. //If this element has a template, and has validators, run them, if any are false, return false.
if (element.template && element.template._validators) { if (element.template && element.template._validators) {
for (var v = 0; v < element.template._validators.length; v++) { for (var v = 0; v < element.template._validators.length; v++) {