label for support for id's with brackets, eg id='name[first]'. fixes #422
This commit is contained in:
parent
7ee6446bc5
commit
f7e78f6ed9
@ -517,6 +517,7 @@
|
|||||||
target=$(e.target);
|
target=$(e.target);
|
||||||
attr = target.attr("for");
|
attr = target.attr("for");
|
||||||
if ("LABEL" === e.target.tagName && attr && attr.length > 0) {
|
if ("LABEL" === e.target.tagName && attr && attr.length > 0) {
|
||||||
|
attr = attr.replace(/([\[\].])/g,'\\$1'); /* escapes [, ], and . so properly selects the id */
|
||||||
target = $("#"+attr);
|
target = $("#"+attr);
|
||||||
target = target.data("select2");
|
target = target.data("select2");
|
||||||
if (target !== undefined) { target.focus(); e.preventDefault();}
|
if (target !== undefined) { target.focus(); e.preventDefault();}
|
||||||
|
Loading…
Reference in New Issue
Block a user