Ticket #7534 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

comment:2 Changed 3 years ago by Corey Frang

  • Status changed from new to closed
  • Resolution set to fixed

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 3 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 3 years ago by gnarf

  • Milestone changed from 1.9 to 1.8.16

comment:5 Changed 2 years ago by scott.gonzalez

#7461 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.