Properly escape CSS notation#1119
Conversation
|
Changes Unknown when pulling d29777c on fkaempfer:master into * on selectize:master*. |
|
Can you point to an example id where that would be the case? |
|
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. |
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? |
|
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) |
|
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! |
|
Fixed, thanks! |
Small problem caused by #755 as it does not escape CSS notation within the id attribute properly. Compare: https://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation/