-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Dropdown] Remote content should handle quotes in item value properly #4592
Comments
The above jsfiddle does not work anymore, but I've experienced the same problem. JSONThis is what the server returns: [{"label":"He said: \"" is a quote\"","value":"hello-html","created":"2017-09-03"}] WiringThis is the $('.ui.dropdown').dropdown({
apiSettings: {
url: '/topics/complete?term={query}',
onResponse: function(results) {
var response = { success : true, results : []};
$.each(results, function(index, item) {
var topic = escapeHTML(item.label);
response.results.push({
name : null === item.created ? '+ ' + topic : topic,
value : topic,
text : escapeHTML(topic) // Yes, it needs to be escaped twice!
});
});
return response;
}
}
}); escapeHTML() takes care of replacing Observations
FixI've put together a fix at https://gist.github.com/thekid/39580dba8dba5b227d5ab57f4ca5ac5e. The diff is against semantic.js from the |
There has been no activity in this thread for 90 days. While we care about every issue and we’d love to see this fixed, the core team’s time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one. However, PRs for this issue will of course be accepted and welcome! If there is no more activity in the next 90 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks! |
This is a confirmed bug, how can I aid in fixing it? Can you give me some directions? |
This is pretty crucial for select tags containing arbitrary data for option values - I'd like this fixed please. |
As this wasn't addressed in 2.4., I'd like to find a solution here, even if it's a workaround or hack. |
Another release (2.4.1) and it seems this bug hasn't been addressed, at least according to the changelog. Please let us know how we can assist you. |
When a JSON response for a remote dropdown contains quotes inside a string, it's misinterpreted as the end of an attribute. See http://jsfiddle.net/1xLsau44/10/ and try inspecting
$(".menu")
.The text was updated successfully, but these errors were encountered: