Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Properly escape CSS notation#1119

Closed
fkaempfer wants to merge 1 commit into
selectize:masterfrom
fkaempfer:master
Closed

Properly escape CSS notation#1119
fkaempfer wants to merge 1 commit into
selectize:masterfrom
fkaempfer:master

Conversation

@fkaempfer
Copy link
Copy Markdown

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 28, 2016

Coverage Status

Changes Unknown when pulling d29777c on fkaempfer:master into * on selectize:master*.

@joallard
Copy link
Copy Markdown
Member

Can you point to an example id where that would be the case?

@fkaempfer
Copy link
Copy Markdown
Author

Sure. One of the most popular Java web frameworks (JSF) creates IDs separated by ":" depending on their position in the DOM, for example "myForm:mySelectField". The ":" causes an exception in the label selector code.

@joallard
Copy link
Copy Markdown
Member

Given I have a label and input field with id 'form:name'
When I selectize this field
Then the resulting field should have id 'form:name-selectized'
And the label should have attr for 'form:name-selectized'

As I understand, that's not currently the case?

@joallard
Copy link
Copy Markdown
Member

Got it. That said, there's an even easier fix: http://stackoverflow.com/q/9763323/720164

- $('label[for='+inputId+']').attr('for', inputId + '-selectized');
+ $("label[for='"+inputId+"']").attr('for', inputId + '-selectized');

I can let you commit that if you want the credit ;o)

@joallard joallard added this to the 0.12.3 milestone Jul 28, 2016
@fkaempfer
Copy link
Copy Markdown
Author

Great, yeah that is much simpler. I checked that it works in my case.

No need to give me credit, but if it makes it easier for you to integrate the fix I can update the PR.

Thanks!

joallard added a commit that referenced this pull request Jul 29, 2016
@joallard
Copy link
Copy Markdown
Member

Fixed, thanks!

@joallard joallard closed this Jul 29, 2016
bwilson-ux pushed a commit to bwilson-ux/selectize.js that referenced this pull request Oct 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants