Skip to content

"Save changes" button in project settings page becomes incorrectly disabled when form elements are clicked quickly

Summary

When quickly making changes to a settings section in the project settings page, the "Save changes" button can become disabled when it shouldn't (i.e. when the form has been changed from its original state).

In most cases, this isn't an issue, as it's difficult to toggle the form elements within the time frame (500 milliseconds). However, when form elements are programmatically updated, this issue is much easier to reproduce. For example, this feature employs some JavaScript to sync two checkboxes: gitlab-org/gitlab-ee!10803.

Steps to reproduce

See GIF below.

Relevant logs and/or screenshots

The checkboxes are initially checked quickly using Tab and Space, and are then unchecked using the mouse:

2019-05-16_16.28.41

Output of checks

This bug happens on GitLab.com.

Possible fixes

Make the throttling in dirty_submit smarter: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/dirty_submit/dirty_submit_form.js#L24

Edited by Nathan Friend