Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/javascript/app/form-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (elements.length !== 0) {
[].forEach.call(elements, function(input) {
input.addEventListener('input', function () {
if (buttons.length !== 0 && input.valid) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bug here is that input.valid returns undefined. I think we're meaning to say input.checkValidity().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was supposed to be validity.valid . Nice catch Hoops! I just assumed the form validation wasn't working and didn't look further.

if (buttons.length !== 0 && input.checkValidity()) {
[].forEach.call(buttons, function(button) {
if (button.disabled) {
button.disabled = false;
Expand Down