Skip to content

Commit

Permalink
Handle form blocking based on invalid fields visibility #2159
Browse files Browse the repository at this point in the history
  • Loading branch information
zahardev committed Dec 6, 2024
1 parent f0c3b62 commit 8353e79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions assets/js/admin-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@
* @param {Event} event
*/
changedSettingsAction: function (event) {
// Make sure that form is blocked if invalid fields become active and unblocked when they become hidden.
var hasVisibleErrorFields = viewGeneralSettings.metaboxObj.find('.gv-error:visible').length > 0;
hasVisibleErrorFields ? viewConfiguration.disable_publish() : viewConfiguration.enable_publish();

viewConfiguration.validateField( $( event.target ) );
viewConfiguration.zebraStripeSettings();
},
Expand Down
Loading

0 comments on commit 8353e79

Please sign in to comment.