Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ export class Formio {
mode: 'open'
});
options.shadowRoot = wrapper;
// Due to an issue with quill not loading styles in the shadowdom, we need to add quill styles and js to the shadowdom
const quill = {
js: `${Formio.cdn.quill}/quill.min.js`,
css: `${Formio.cdn.quill}/quill.snow.css`
}
await Formio.addLibrary(wrapper, quill, 'quill');
}

element.parentNode.removeChild(element);
Expand Down
14 changes: 14 additions & 0 deletions src/components/_classes/component/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2788,6 +2788,19 @@
return Promise.resolve(editor);
}
else {
// Due to an issue with ckeditor not loading styles in the shadowdom (https://github.com/ckeditor/ckeditor5/issues/15824), we need to copy cke-styles to the shadowdom
let current = element;
while (current) {
if (current instanceof ShadowRoot) {
const ckeStyles = document.querySelector('style[data-cke="true"]');
const clone = document.createElement('style');
clone.setAttribute('data-cke', 'true');
clone.textContent = ckeStyles.textContent;
current.prepend(clone);
break;
};
current = current.parentNode || current.host;
}
return ClassicEditor.create(element, settings).then(editor => {
editor.model.document.on('change', () => onChange(editor.data.get()));
return editor;
Expand Down Expand Up @@ -2876,6 +2889,7 @@
editor.setOptions(settings);
editor.getSession().setMode(settings.mode);
editor.on('change', () => onChange(editor.getValue()));
editor.renderer.attachToShadowRoot();
if (settings.isUseWorkerDisabled) {
editor.session.setUseWorker(false);
}
Expand Down Expand Up @@ -3132,7 +3146,7 @@
* Returns if the value (e.g. array) should be divided between several inputs
* @returns {boolean}
*/
isSingleInputValue() {

Check warning on line 3149 in src/components/_classes/component/Component.js

View workflow job for this annotation

GitHub Actions / setup

Missing JSDoc @returns description
return false;
}

Expand Down
Loading