1
0
mirror of synced 2024-11-26 14:56:07 +03:00

fix label focussing bug on ios. fixes #1008.

This commit is contained in:
Igor Vaynberg 2013-03-19 09:14:37 -07:00
parent 45559654bc
commit 519070b11d

View File

@ -1661,6 +1661,11 @@ the specific language governing permissions and limitations under the Apache Lic
this.focusser = container.find(".select2-focusser"); this.focusser = container.find(".select2-focusser");
// rewrite labels from original element to focusser
this.focusser.attr("id", "s2id_autogen"+nextUid());
$("label[for='" + this.opts.element.attr("id") + "']")
.attr('for', this.focusser.attr('id'));
this.search.bind("keydown", this.bind(function (e) { this.search.bind("keydown", this.bind(function (e) {
if (!this.enabled) return; if (!this.enabled) return;
@ -2104,6 +2109,11 @@ the specific language governing permissions and limitations under the Apache Lic
this.searchContainer = this.container.find(".select2-search-field"); this.searchContainer = this.container.find(".select2-search-field");
this.selection = selection = this.container.find(selector); this.selection = selection = this.container.find(selector);
// rewrite labels from original element to focusser
this.search.attr("id", "s2id_autogen"+nextUid());
$("label[for='" + this.opts.element.attr("id") + "']")
.attr('for', this.search.attr('id'));
this.search.bind("input paste", this.bind(function() { this.search.bind("input paste", this.bind(function() {
if (!this.enabled) return; if (!this.enabled) return;
if (!this.opened()) { if (!this.opened()) {