prevent opening of a disabled select via api. fixes #1272
This commit is contained in:
parent
92ceb93e93
commit
5762b85dd2
@ -963,8 +963,6 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
|
|
||||||
// sync enabled state
|
// sync enabled state
|
||||||
|
|
||||||
//console.log("sync enabled: ", this._enabled, "readonly: ", this._readonly);
|
|
||||||
|
|
||||||
var disabled = el.prop("disabled");
|
var disabled = el.prop("disabled");
|
||||||
if (disabled === undefined) disabled = false;
|
if (disabled === undefined) disabled = false;
|
||||||
this.enable(!disabled);
|
this.enable(!disabled);
|
||||||
@ -1161,6 +1159,8 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
|
|
||||||
if (this.opened()) return false;
|
if (this.opened()) return false;
|
||||||
|
|
||||||
|
if (this._enabled === false || this._readonly === true) return false;
|
||||||
|
|
||||||
event = $.Event("select2-opening");
|
event = $.Event("select2-opening");
|
||||||
this.opts.element.trigger(event);
|
this.opts.element.trigger(event);
|
||||||
return !event.isDefaultPrevented();
|
return !event.isDefaultPrevented();
|
||||||
|
Loading…
Reference in New Issue
Block a user