Render an iframe using formio

I’m tring to make a new formio.js component to render iframes because i want something easy to show PDF files for example but the iframe does not work. Everything is rendered except the iframe… I did not succeed to use the html element neither. Did someone aldready did this ?

Here’s my view :

    <p>{{ ctx.schema.title }}</p>
        id="iframe-elr4tq" seamless="true" class="formio-iframe"></iframe>

and the result : enter image description here

Thank you


Found the way to make it ! If someone is having the same truble :

1) Add a with a ref attribute :

    <p>{{ ctx.schema.title }}</p>
    <div ref="{{ ctx.key }}"></div>
  1. Change the innerHTML within the attach function :
  attach(element) {
    const refs = {};
    refs[this.component.key] = "pdf_div" // on recupere le ref="{{ ctx.key }}"

    this.loadRefs(element, refs); // Chargement de tous les refs

    this.div_pdf =[this.component.key], 0)[0]; // Return an array of matching refs (with [this.component.key])
    this.div_pdf.innerHTML = '<iframe src="" width="" height=""></iframe>' // Set the iframe to see the pdf

    // Allow basic component functionality to attach like field logic and tooltips.
    return super.attach(element);