angular-editor icon indicating copy to clipboard operation
angular-editor copied to clipboard

Generated CSS effects on other areas. Tried with ShadowDom but didn't work.

Open akib1997 opened this issue 2 years ago • 4 comments

image

Generated CSS effects on other areas. Tried with ShadowDom but didn't work. Generated style tag overrides my CSS and effects them. I'm building a template Editor.

akib1997 avatar Oct 13 '22 12:10 akib1997

Hi @akib1997 why did you close this issue? I'm with the same issue.

I added the component into my own component with ViewEncapsulation.ShadowDom but now I'm facing the following error:

core.mjs:7635 ERROR TypeError: Cannot read properties of null (reading 'classList')
    at EmulatedEncapsulationDomRenderer2.removeClass (platform-browser.mjs:619:12)
    at BaseAnimationRenderer.removeClass (animations.mjs:280:23)
    at kolkov-angular-editor.mjs:642:24
    at Array.forEach (<anonymous>)
    at AngularEditorToolbarComponent.triggerButtons (kolkov-angular-editor.mjs:635:22)
    at AngularEditorComponent.exec (kolkov-angular-editor.mjs:1138:28)
    at AngularEditorComponent_Template_div_click_5_listener (kolkov-angular-editor.mjs:1203:2299)
    at executeListenerWithErrorHandling (core.mjs:15637:16)
    at wrapListenerIn_markDirtyAndPreventDefault (core.mjs:15672:22)
    at HTMLDivElement.<anonymous> (platform-browser.mjs:459:38)

Maransatto avatar Oct 25 '22 18:10 Maransatto

+1 I have the same problem

triggerButtons() { if (!this.showToolbar) { return; } this.buttons.forEach(e => { const result = this.doc.queryCommandState(e); const elementById = this.doc.getElementById(e + '-' + this.id); if (result) { this.r.addClass(elementById, 'active'); } else { this.r.removeClass(elementById, 'active'); } }); }

The object "this.doc" must be shadowRoot. Otherwise it cannot find it by doing getElementById from the parent document object

tahsinpol avatar Jan 05 '23 13:01 tahsinpol

same problem here, with ViewEncapsulation.ShadowDom solve the problem but this console error keeps there "cannot read properties of null (reading 'classList')"

image

matpinsdorf avatar Nov 23 '23 14:11 matpinsdorf

Same issue, did anybody find a workaround ?

DautbegovicDavid avatar Jun 12 '24 11:06 DautbegovicDavid