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
Setting data-content muddles up the title for the selected option #469
Comments
I also have the same problem. Looked at the code a little bit. The title is set here:
and the selectedItems array is filled right above:
but I don't know what the right solution might be. I thought about escaping the html into plain text but this might not be a good solution. |
The solution could be to simply use the text between the |
I was having the same issue. I just hacked it locally for now. The change:
Feel free to make this change or turn it into a pull request. |
I also was having this problem. My solution is to use CSS to hide what you need to hide, while an option is selected and its "data-content" is displayed in the "button" element. button.selectpicker img { display: none; } |
@marionoak wouldn't that just hide the image of the flag? The whole point of using this library was to display the flag. It's overdue, but I'll send in a PR anyway to fix this by stripping out the HTML in the |
@t0xicCode you're right! I hadn't checked it since opening the issue (a long time ago). Ran a quick test now and it works fine. Thanks 👍 |
With the latest 1.6.3 the issue is present again, this was broken in this latest release, 1.6.2 works as expected. |
See @jgambarios's note above .. seems like the issue has resurfaced. |
Any news on this one?, would be great to have it fix for the next release. Thanks! |
+1 |
+! |
Just in my opinion this issue is critical because all we use the data-content wont be able to upgrade, this is an error that I can not allow the visitors of my site to see. |
+1 |
@jgambarios - if you're hosting the file locally, you can apply the change in 4e61593 and it should work. (Sucks to update out of band like that, but in a pinch it might help.) |
I've been trying to replicate this on my end. It'd be nice to get this squashed finally. Can anybody link me to an example? |
Sure thing: http://snipe.github.io/bootstrap-select-demo/ When you mouseover the dropdown (without clicking on it), you can see the title attribute pops up this: Applying the fix from 4e61593 (which looks like a regression issue, since it's not in the current version) solves it. |
For easy reference, the select code is here:
With this JS at the bottom:
|
Can you update that to 1.6.5 to see if it persists? It's working for me with 1.6.5 in my test environment. |
It's using 1.6.3 - did you mean could I update to 1.6.5?
|
I can confirm this is fixed in 1.6.5: http://snipe.github.io/bootstrap-select-demo/ |
Yes, I meant 1.6.5 - sorry. Happy to hear it's working. I'll wait for confirmation from others to ensure it's working as expected for them before closing this out. |
I've added some HTML in the
data-content
attribute of the<option>
s so it displays a flag next to the list of countries.Problem is, when I hover over the selected option, I see a tooltip with the HTML that I entered (and it looks gross). I noticed this happens because the
title
for the displayed element takes the value of thedata-content
attribute for some reason.Here's the detailed HTML I'm using:
The text was updated successfully, but these errors were encountered: