Skip to content

Commit 3aa5ccd

Browse files
Mike Taylordeepthivenkat
Mike Taylor
authored andcommitted
Issue webcompat#1167. Check optional os and browser fields inside of checkForm.
1 parent aa53a58 commit 3aa5ccd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webcompat/static/js/lib/bugform.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,15 @@ function BugForm() {
223223
this.checkURLValidity();
224224
this.checkProblemTypeValidity();
225225
this.checkImageTypeValidity();
226-
this.checkOptionalNonEmpty();
227226
// and open the form, if it's not already open
228227
if (!this.reportButton.hasClass('is-open')) {
229228
this.reportButton.click();
230229
}
231230
}
231+
// Make sure we only do this if the inputs exist on the page
232+
if (this.browserField.length || this.osField.length) {
233+
this.checkOptionalNonEmpty();
234+
}
232235
};
233236

234237
/* makeInvalid can take an {altHelp: true} options argument to select

0 commit comments

Comments
 (0)