-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding container support issue #3222 #3324
Conversation
Fixes issue select2#3222 Now templateSelection can have access to the parent container so that classes can be added for styling
text: 'test' | ||
}, $container); | ||
|
||
for (var i = 0; i < $container[0].classList.length; i += 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to just use $container[0].classList.contains('testclass')
here. Though that isn't supported in IE8, I'd just use $container.hasClass('testclass')
honestly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did think that was a bit average but was struggling to think of a better way last night.
Thanks for the feedback, also helped me pick up that I had forgotten to rename the variable so it wasn't actually being tested anyway :(
Improving my test from feedback.
The only thing holding me back on merging this is that the single and multiple selection templates now have different parameters. If we can integrate this in with |
I didn't really think it was applicable to single select due to it not really using the tag template and it seemed to fall back ok if you didn't use the container but it shouldn't be hard to add to the single selection and no doubt somebody will find a use. |
Finally got around to adding the single select support, hopefully that is ready to merge now |
Adding container support issue #3222
Looks good, thanks for adding support for the single select as well. |
No worries |
Fixes issue #3222
Now templateSelection can have access to the parent container so that
classes can be added for styling