Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#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:2 Changed 12 years ago by Corey Frang

Resolution: fixed
Status: newclosed

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 Corey Frang

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 Corey Frang

Milestone: 1.91.8.16

comment:5 Changed 11 years ago by Scott González

#7461 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.