lindell / JsBarcode

Barcode generation library written in JavaScript that works in both the browser and on Node.js
http://lindell.me/JsBarcode
MIT License
5.45k stars 1.1k forks source link

In ShadowDom : NoElementException: No element to render on. #422

Open AshMcConnell opened 1 year ago

AshMcConnell commented 1 year ago

Hi Folks,

Having trouble when I have my Angular element in the shadow dom. It can't seem to find the element. I am loading in the javascript to execute JsBarcode from a server and creating a script element on the shadowRoot. It is executing, but it can't find the element in question.

Is there any way to work around this issue?

set scriptContents(javascript: string) {
        this._scriptContents = javascript;
        const scriptElement = document.createElement('script');

        scriptElement.textContent = javascript;
        this.elementRef.nativeElement.shadowRoot.appendChild(scriptElement);
    }
arcanisgk commented 2 months ago

same problem with BS4.X modals