#7534 closed bug (fixed)
Button label selector omits quotes / fails for ids with ":"
Reported by: | jabouillei | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8.16 |
Component: | ui.button | Version: | 1.8.14 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The button label selector uses the id of the checkbox without quoting it. Here is the relevent line of UI Button code:
labelSelector = "label[for=" + this.element.attr("id") + "]";
If the id contains a colon or some other interesting character labelSelector becomes, for example,
label[for=sample:123]
instead of
label[for="sample:123"]
Here is a jsfiddle demonstrating the problem: http://jsfiddle.net/jgQaV/1/
I encountered the problem in 1.8.11 and reproduced it in 1.8.14. The fix is trivial:
labelSelector = "label[for=\"" + this.element.attr("id") + "\"]";
I'm making this change in a github fork and will request a pull in a few minutes.
Change History (5)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Button: Adding quotes to the attribute selector for labels - Fixes #7534 - Button label selector omits quotes / fails for ids with ":"
Changeset: 065aef537b7533046907fcffc6896949e44679eb
comment:3 Changed 12 years ago by
Button: Adding quotes to the attribute selector for labels - Fixes #7534 - Button label selector omits quotes / fails for ids with ":" (cherry picked from commit 065aef537b7533046907fcffc6896949e44679eb)
Conflicts:
ui/jquery.ui.button.js
Changeset: 07d5271f7eac17a1a732b562b836b12a889e3b60
comment:4 Changed 12 years ago by
Milestone: | 1.9 → 1.8.16 |
---|
Here is a link to a fix: https://github.com/jabouillei/jquery-ui/commit/5bed24df73920df74c7ed47938d49bb680948699