Skip to content

Sending questions with trailing spaces using enter fails to trim(). - fix included #2328

@jimmyjames177414

Description

@jimmyjames177414

Screenshots

Network call sending trailing spaces:
image

webchat.js needs .trim() added to the following:
image

webchat-es5.js needs .trim() added to the following:
image

Version

This issue can be found on the following CDN's as of 8/16/2019:
https://cdn.botframework.com/botframework-webchat/master/webchat.js
https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js

https://cdn.botframework.com/botframework-webchat/latest/webchat.js
https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.js

Describe the bug

When sending text with trailing spaces, such as "what is AI ", and then clicking enter to submit, the trailing spaces are not stripped and the network call sends the trailing white spaces as shown above.

To Reproduce

Steps to reproduce the behaviour:

  1. Go to the textbox and type 'Jim is cool '
  2. Press Enter key
  3. Check network call and see that what is sent is the string 'Jim is cool '

Expected behaviour

When submitting a question using the enter key, the question should be stripped of trailing white spaces (the same way the click to submit works).

Additional context

I have attached the two scripts with the fix:
space fix.zip

As a special request, could you send a text to (219) 310- 5041 when this bug is fixed? This is a high priority fix for our product.

[Bug]

Metadata

Metadata

Assignees

Labels

Bot ServicesRequired for internal Azure reporting. Do not delete. Do not change color.bugIndicates an unexpected problem or an unintended behavior.customer-replied-toRequired for internal reporting. Do not delete.customer-reportedRequired for internal Azure reporting. Do not delete.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions