Skip to content
Snippets Groups Projects
Commit ae8bcad8 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2563505 by javivf, adooo, Wim Leers, Truptti, DuaelFr, Reinmar,...

Issue #2563505 by javivf, adooo, Wim Leers, Truptti, DuaelFr, Reinmar, quicksketch, FMB: "Enter caption here" text missing due to auto-created <br>
parent 680ef1c7
No related branches found
No related tags found
No related merge requests found
......@@ -210,6 +210,15 @@
// upcasting existing elements (see widgetDefinition.upcast).
if (dialogReturnValues.attributes.hasCaption) {
actualWidget.editables.caption.setAttribute('data-placeholder', placeholderText);
// Some browsers will add a <br> tag to a newly created DOM
// element with no content. Remove this <br> if it is the only
// thing in the caption. Our placeholder support requires the
// element be entirely empty. See filter-caption.css.
var captionElement = actualWidget.editables.caption.$;
if (captionElement.childNodes.length === 1 && captionElement.childNodes.item(0).nodeName === 'BR') {
captionElement.removeChild(captionElement.childNodes.item(0));
}
}
};
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment