• I am combining Accordion blocks with PDF Embedder plugin in order to reveal pdfs on demand. When an accordion item (containing a pdf) is defined as closed on page load and afterwards expanded on demand, the pdf has been rendered as too small and is not shown. A half solution is to pre-define a fixed width for the pdf, which is not responsive. Ideally an accordion item would keep its expanded width when contracted. This would help the pdfs to render optimally inside a contracted accordion item, in max width.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author philbuchanan

    (@philbuchanan)

    Unfortunately I think this is an issue with how the PDF embed tool works. It looks like it is using a canvas element. I’m guessing it determines the width of the embed based on the width of the accordion item at the time of page render. The way this plugin works, the entire accordion item content is completely hidden, meaning it doesn’t really have a width yet. I have to do that to avoid weird flickers of seeing all the content until the full accordion JS loads.

    You may be able to dynamically redraw the embed (assuming the PDF embed tool has Javascript events you can tie into) when opening an accordion item, but other than that, I’m not sure what else to suggest.

    You may want to try a different accordion plugin to see if you get different/better results. Other plugins will work different than mine.

Viewing 1 replies (of 1 total)
  • The topic ‘Can Accordion blocks items keep their expanded width when they are contracted?’ is closed to new replies.