In the latest version of the js api (4.14), when I create a simple popup template like this:
...
popupTemplate:{
title: 'test',
content: '<div class="customClass">Green</div>'
}...
Why is my "customClass" being removed in the resulting popup html?
Here is a simple example in JS Bin: JS Bin - Collaborative JavaScript Debugging
In this example, I would have expected the "Green" text in the body of the popup to appear green.
This issue doesn't seem to happen when reverting back to the 4.13 version of the api.
Solved! Go to Solution.
Hello,
In 4.14, we are using a HTML sanitizer (https://github.com/Esri/arcgis-html-sanitizer) which removes some HTML for security purposes. We may be able to do something for this in 4.15.
As an alternative workaround to a HTML string, you can do the following to modify a dom node directly.
var template = {
content: function(){
var div = document.createElement("div");
div.className = "myClass";
div.innerHTML = "<span>My custom content!</span>";
return div;
}
};
Hello,
In 4.14, we are using a HTML sanitizer (https://github.com/Esri/arcgis-html-sanitizer) which removes some HTML for security purposes. We may be able to do something for this in 4.15.
As an alternative workaround to a HTML string, you can do the following to modify a dom node directly.
var template = {
content: function(){
var div = document.createElement("div");
div.className = "myClass";
div.innerHTML = "<span>My custom content!</span>";
return div;
}
};
Matt. Please would you include this fix in 4.15. Much appreciated
Have this been fix in 4.18 ?