microsoft / microsoft/BotFramework-WebChat

[Omnichannel] Setting `sendBoxTextWrap` via `createStyleSet` is being ignored

Open
#4,067 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bot Services bug needs-team-attention
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

Screenshots

image

Version

4.14.*

Describe the bug

When setting sendBoxTextWrap in styleOptions, it works. The send box text box would become <textarea> (text wrap = multiline).

When setting sendBoxTextWrap in createStyleSet and set it through styleSet prop, it did not work. The send box still is <input> (single line = not text wrap).

Steps to reproduce

Use the following code to render Web Chat.

window.WebChat.renderWebChat(
  {
    directLine: window.WebChat.createDirectLine({ token }),
    styleSet: window.WebChat.createStyleSet({
      backgroundColor: 'orange',
      sendBoxTextWrap: true
    })
  },
  document.getElementById('webchat')
);

Expected behavior

It should render the background as orange. Plus, the send box should be <textarea>.

Additional context

Workaround could for now is to set both styleOptions and styleSet props. sendBoxTextWrap only need to pass to the styleOptions prop.

image

When fixing this issue, check if we are also doing it correctly for sendTimeout or other values that is not represented in CSS.

[Bug]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the createStyleSet and renderWebChat entry points, comparing how styleOptions and the styleSet prop handle sendBoxTextWrap and other non-CSS values such as sendTimeout. Reproduce the issue with the provided example; done means the styleSet configuration renders the orange background and uses a textarea for the send box without requiring styleOptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.