ignore configured placeholder on selects without first empty option. fixes #785
This commit is contained in:
parent
76295bb5e9
commit
a19e33e3af
@ -836,7 +836,6 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
this.opts.element.blur();
|
this.opts.element.blur();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
enable: function() {
|
enable: function() {
|
||||||
if (this.enabled) return;
|
if (this.enabled) return;
|
||||||
@ -1351,6 +1350,14 @@ the specific language governing permissions and limitations under the Apache Lic
|
|||||||
|
|
||||||
// abstract
|
// abstract
|
||||||
getPlaceholder: function () {
|
getPlaceholder: function () {
|
||||||
|
|
||||||
|
// if a placeholder is specified on a select without the first empty option ignore it
|
||||||
|
if (this.select) {
|
||||||
|
if (this.select.find("option").first().text() !== "") {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this.opts.element.attr("placeholder") ||
|
return this.opts.element.attr("placeholder") ||
|
||||||
this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
|
this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
|
||||||
this.opts.element.data("placeholder") ||
|
this.opts.element.data("placeholder") ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user