BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

WebChat Send Box takes up entire iFrame in iOS

Open akamwand opened this issue 5 years ago • 6 comments

Screenshots

image image

Version

Running latest WebChat V4

Describe the bug

The webChat window should dynamically resize to HTML iFrame element on mobile iOS viewports, however, I am seeing the Send Message area blowing up to nearly the full iFrame height on iOS viewports.

To add some important context here : I am using an iFrame element within Wix and embedding my bot HTML code into the iFrame element. The webChat window resizing works like a charm for desktop viewports, but for mobile and specifically iOS viewports, the webChat window blows the send box up to nearly the full height of the iFrame. I thought by specifying both the width and height of the body and webChat window in HTML, the iFrame element within Wix would display the webChat window with those precise width and height yet it does not.

I may be running into this Open issue here but I was unsure if this is the root cause: iOS handling of any iFrame element (https://github.com/microsoft/BotFramework-WebChat/issues/2044#issuecomment-503655312)

What leaves me puzzled is that I tested passing my bot to the Wix iFrame element using the iFrame HTML code from the Web Chat Channel from my Bot Service and that re-sized the webChat window exactly how I needed it to in mobile iOS Safari. This, unfortunately, does not allow any styling however. If there was somehow a way to package the Direct Line webChat HTML into an iFrame with specified width/height , that would be perfect but I could not seem to find that solution anywhere in regards to webChat.

Expected behavior

webChat window should dynamically resize to HTML iFrame element on mobile iOS viewports.

[Bug]

akamwand avatar Dec 22 '20 06:12 akamwand

The issue is occurring because you are passing defined values to height and width in "#webchat>*". If you leave those two values set at 100%, the issue goes away. Can you please reset those two values and try again?

<style>
  html,
  body {
    height: 300px;
    width: 400px;
  }

  #webchat>* {
    height: 100%;
    width: 100%;
  }
</style>

stevkan avatar Dec 22 '20 18:12 stevkan

@stevkan Thank you for the suggestion, I tried it out but unfortunately I get the same result where the send box takes up the full height of the iframe that I am placing my HTML in. The screenshot below is with your style changes implemented. image

I have also attached the screenshot below, where I take my Web Chat provided iFrame, and then place that into another iFrame element on my Wix site. There's unfortunately no way around the iframe-within-an-iframe aspect for Wix integration at the moment. I'm curious as to why the webchat is responsive, like in the below screenshot, when I specify the iFrame width/height, but not responsive when I specify the #webchat width/height in the V4 styling framework.

<iframe src='https://webchat.botframework.com/embed/mybot='key' style='border:none; min-width: 300px; width: 100%; height: 100%; overflow:hidden'></iframe>

image

akamwand avatar Dec 23 '20 03:12 akamwand

I believe it just comes down to the nature of an iframe element. As Mozilla defines it here,

The HTML Inline Frame element (