https://discord.gg/botpress logo
Unable to Extend Botpress Webchat v2.4 Container B...
# 🤝help
g
Hello team, I’m embedding Botpress Webchat v2.4 on my site. I want the bot to be full screen height and width. Above a viewport width of 767 px, the chat container is capped at 700 px tall by this built-in rule:
Copy code
@media (min-width: 768px) {
  .bpWebchat {
    max-height: 700px;
    height:     min(700px, calc(100% - 120px));
  }
}
I need the chat interface to occupy the full viewport height, so I added the following override in Webchat → Custom CSS:
Copy code
@media (min-width: 768px) {
  .bpOpen.bpWebchat {
    max-height: 100vh !important;
    height:     100vh !important;
  }
}
I also tried adding this to the html source This doesnt work because I believe that I cant target selectors inside the iframe, i thought adding custom styles in the webchat tab in dashboard would work. I have hard-refreshed to clear page and CSS caches Despite this, the internal .bpWebchat rule still enforces the 700 px cap. Is there a way to override this? Thank you.
so it basically adds a white horizontal strip at the bottom so the height doenst exceed 700 px
p
Can you send an image of the current display?
l
I can't get any of the fullscreen embed code to work from the documentation
p
What tool are you using to see the window dimensions?
Can you elaborate on your issue and goal?
l
https://jsfiddle.net/Zannax_Botpress/h8g1kx7f/ This snippet works as is if I paste it in, but my src URLs are different and my config is v2.5 mediafiles.botpress.cloud vs files.bpcontent.cloud
I cannot simply swap these out to make it work?
it's like it's not compatible with my config
I just want to recreate this with my own bot info and drop this in a div
The documentation on here https://botpress.com/docs/webchat/embedding-webchat#in-an-html-div does not yield the same results
I feel like the documentation has to be wrong, because it's not working with my bot info
Copy code
<div style="width: 100%; height: 600px;">
  <iframe id="bpFull" style="width: 100%; height: 100%; border: none;" srcdoc="
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset='utf-8' />
        <script src='https://cdn.botpress.cloud/webchat/v2.2/inject.js'></script>
        <script src='https://mediafiles.botpress.cloud/26a83f89-ace1-4045-92ba-95b836f75669/webchat/v2/config.js'></script>
        <script>
          window.botpress.on('webchat:ready', () => { botpress.open(); });
        </script>
        <style>
          html, body {
            margin: 0;
            padding: 0;
            overflow: hidden;
            height: 100%;
          }
          .bpWebchat {
            width: 100% !important;
            height: 100% !important;
            right: 0 !important;
            bottom: 0 !important;
            max-height: 100% !important;
            overflow: auto !important;
            -webkit-overflow-scrolling: touch;
          }
        </style>
      </head>
      <body></body>
    </html>
  "></iframe>
</div>
working with demo, cannot get it to work/load my bot
g
errrr, this is the iframe method, i didnt use this one.
embed it in a div like so (this goes in the body)
Copy code
<div id="webchat-container" style="position: relative; width: 100vw; height: 100vh;">
      <script src="https://cdn.botpress.cloud/webchat/v2.4/inject.js"></script>
      <script>
then this goes in the head:
Copy code
<meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
@prehistoric-airplane-85682 Please tell me you found out how to override that CSS rule 😎
p
I've successfully changed the max height by adding the code you shared in your first message to my style section.
g
@prehistoric-airplane-85682 legend
8 Views