Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit d0fc381

Browse files
committed
Fixes #2541 — Properly applies “disabled” styling and logic to flip switches, sliders, and custom selects based on disabled attribute in underlying input markup.
1 parent 0f81773 commit d0fc381

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

js/jquery.mobile.forms.select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
122122
}
123123

124124
// Disable if specified
125-
if ( options.disabled ) {
125+
if ( options.disabled || this.element.attr('disabled')) {
126126
this.disable();
127127
}
128128

js/jquery.mobile.forms.slider.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ $.widget( "mobile.slider", $.mobile.widget, {
215215
},
216216

217217
refresh: function( val, isfromControl, preventInputUpdate ) {
218-
if ( this.options.disabled ) { return; }
218+
219+
if ( this.options.disabled || this.element.attr('disabled')) {
220+
this.slider.addClass('ui-disabled');
221+
return;
222+
}
219223

220224
var control = this.element, percent,
221225
cType = control[0].nodeName.toLowerCase(),

0 commit comments

Comments
 (0)