Skip to content

Commit f92a887

Browse files
committed
Remove default classes and styles for invalid/unsanitary fields
1 parent 59c20fc commit f92a887

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

widget-customizer.css

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@
5050
opacity: 0.5;
5151
}
5252

53-
.customize-control-widget_form .widget-content input,
54-
.customize-control-widget_form .widget-content select,
55-
.customize-control-widget_form .widget-content textarea {
56-
-webkit-transition: background-color 0.2s;
57-
transition: background-color 0.2s;
58-
}
59-
.customize-control-widget_form .widget-content .client-invalid,
60-
.customize-control-widget_form .widget-content .server-invalid {
61-
background-color: #ffeeee;
62-
}
63-
6453

6554
.customize-control-widget_form.is-live-previewable .widget-control-save {
6655
display: none;

widget-customizer.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -897,15 +897,8 @@ var WidgetCustomizer = ( function ($) {
897897
// Handle widgets that support live previews
898898
if ( control.params.is_live_previewable ) {
899899
widget_content.on( 'change input propertychange', ':input', function ( e ) {
900-
var input = $( this );
901-
var is_valid = ( this.checkValidity && this.checkValidity() );
902-
if ( e.type === 'change' || is_valid ) {
903-
if ( is_valid ) {
904-
input.removeClass( 'client-invalid' );
905-
}
900+
if ( e.type === 'change' || ( this.checkValidity && this.checkValidity() ) ) {
906901
trigger_save();
907-
} else if ( this.checkValidity && ! this.checkValidity() ) {
908-
input.addClass( 'client-invalid' );
909902
}
910903
} );
911904
}
@@ -1124,17 +1117,10 @@ var WidgetCustomizer = ( function ($) {
11241117
// it will be updated upon the change event
11251118
if ( args.ignore_active_element || ! input.is( document.activeElement ) ) {
11261119
input.prop( property, sanitized_state );
1127-
input.removeClass( 'server-invalid' );
1128-
input.removeClass( 'client-invalid' );
1129-
// @todo Yellowfade?
1130-
} else {
1131-
input.addClass( 'server-invalid' );
11321120
}
11331121
control.hook( 'unsanitaryField', input, sanitized_state, state );
11341122

11351123
} else {
1136-
input.removeClass( 'server-invalid' );
1137-
input.removeClass( 'client-invalid' );
11381124
control.hook( 'sanitaryField', input, state );
11391125
}
11401126
} );

0 commit comments

Comments
 (0)