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

Problem with buttons

Open jcmontx opened this issue 9 years ago • 10 comments

I'm having a problem with the buttons when using the last version of the webchat.

Last release: image

Older release: image

Any css fix I could use?

jcmontx avatar Jan 26 '17 17:01 jcmontx

@jcmontx thanks for reporting this. Can you tell me what is the width of your webchat canvas / window ?

danmarshall avatar Jan 27 '17 23:01 danmarshall

@danmarshall 300px

jcmontx avatar Jan 30 '17 12:01 jcmontx

@jcmontx change this in the botchat.css It helped me. width: 188px;
/* padding: 0 16px; */

.wc-card button { background-color: transparent; color: #3A96DD; min-height: 32px; width: 100%; width: 188px;
/* padding: 0 16px; */

}

Lipa9963 avatar Feb 03 '17 16:02 Lipa9963

The .wc-card class has an attribute: width: 302px. I removed this and the card now fits to the .message-content parent element nicely.

busbyk avatar Feb 10 '17 18:02 busbyk

Thanks for your patience and for the workarounds everyone :) FYI - We are working on a smaller card size. Which means we are also working on the mechanism to detect the proper card size. As you may know, we support 2 customer scenarios: iframe and in-page.

For iframe, the mechanism can be accomplished with a CSS media query, based on the width of the page. Conversely, this might not work for every in-page scenario. An app may have its own layout rules or events. So, the in-page scenario will give this responsibility to the page.

The beginnings of this paradigm are in my PR #338

danmarshall avatar Feb 10 '17 18:02 danmarshall

Hi @jcmontx can you please get the latest WebChat control and see if this issue is fixed. I am going to close this issue for now, but please re-open if it is not solved.

Also, 300px is about the smallest possible size, it may not be the best experience. We are targeting 320px as the smallest target we want to support.

danmarshall avatar Mar 16 '17 00:03 danmarshall

@danmarshall this is how it looks with the lastest version and 320px width

image

jcmontx avatar Mar 27 '17 17:03 jcmontx

Hi @jcmontx - I have a couple of questions. Are you self-hosting the WebChat, or are you iframing the webchat.botframework.com ? If you are self- hosting, are you hosting your own iframe or using the chat in a div in your own page?

danmarshall avatar Mar 27 '17 18:03 danmarshall

@danmarshall I'm self-hosting the webchat since I do a little customization and I use the chat as a div in my page.

jcmontx avatar Mar 27 '17 20:03 jcmontx

@jcmontx ok! So, you will need to do a couple of things, we had some breaking changes for self-hosted WebChats:

  1. Since you are hosting in a div you will need to manually set the card size. (In the full-window version, we use a CSS media query). In the div-in-page version you should add a CSS class wc-narrow to the containing div. See the readme and an example
  2. If your chat dynamically resizes - you will want the WebChat to listen for resize events. This is so carousels can utilize all the space they are given. This is orthogonal but somewhat related to card size. Add the resize: 'detect' options when instantiating BotChat.App. Example

danmarshall avatar Mar 27 '17 21:03 danmarshall