diff --git a/CHANGELOG.md b/CHANGELOG.md index 273d225ba0..d60ebe0325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Fix [#2328](https://github.com/microsoft/BotFramework-WebChat/issues/2328). Updating submitSendBoxSaga.js to send sendBoxValue.trim(), by [@jimmyjames177414](https://github.com/jimmyjames177414) in PR [#2331](https://github.com/microsoft/BotFramework-WebChat/pull/2331) - Fix [#2160](https://github.com/microsoft/BotFramework-WebChat/issues/2160). Clear suggested actions after clicking on a suggested actions of type `openUrl`, by [@tdurnford](https://github.com/tdurnford) in PR [#2190](https://github.com/microsoft/BotFramework-WebChat/pull/2190) - Fix [#1954](https://github.com/microsoft/BotFramework-WebChat/issues/1954). Estimate clock skew and adjust timestamp for outgoing activity, by [@compulim](https://github.com/compulim) in PR [#2208](https://github.com/microsoft/BotFramework-WebChat/pull/2208) - Fix [#2240](https://github.com/microsoft/BotFramework-WebChat/issues/2240). Fix microphone button should be re-enabled after error, by [@compulim](https://github.com/compulim) in PR [#2241](https://github.com/microsoft/BotFramework-WebChat/pull/2241) diff --git a/packages/component/src/SendBox/SendButton.js b/packages/component/src/SendBox/SendButton.js index 0d88c1f510..e6ec53515f 100644 --- a/packages/component/src/SendBox/SendButton.js +++ b/packages/component/src/SendBox/SendButton.js @@ -8,19 +8,16 @@ import SendIcon from './Assets/SendIcon'; const connectSendButton = (...selectors) => connectToWebChat( - ({ disabled, language, sendBoxValue, setSendBox, submitSendBox }) => ({ - click: () => { - setSendBox(sendBoxValue.trim()); - submitSendBox(); - }, + ({ disabled, language, submitSendBox }) => ({ disabled, - language + language, + submitSendBox }), ...selectors ); -const SendButton = ({ click, disabled, language }) => ( - +const SendButton = ({ disabled, language, submitSendBox }) => ( + ); @@ -30,9 +27,9 @@ SendButton.defaultProps = { }; SendButton.propTypes = { - click: PropTypes.func.isRequired, disabled: PropTypes.bool, - language: PropTypes.string.isRequired + language: PropTypes.string.isRequired, + submitSendBox: PropTypes.func.isRequired }; export default connectSendButton()(SendButton); diff --git a/packages/component/src/SendBox/TextBox.js b/packages/component/src/SendBox/TextBox.js index b61173aa5f..2438535707 100644 --- a/packages/component/src/SendBox/TextBox.js +++ b/packages/component/src/SendBox/TextBox.js @@ -31,7 +31,6 @@ const connectSendTextBox = (...selectors) => event.preventDefault(); if (sendBoxValue) { - setSendBox(sendBoxValue.trim()); scrollToEnd(); submitSendBox(); focusSendBox(); diff --git a/packages/core/src/sagas/submitSendBoxSaga.js b/packages/core/src/sagas/submitSendBoxSaga.js index 47a073eed3..344142e823 100644 --- a/packages/core/src/sagas/submitSendBoxSaga.js +++ b/packages/core/src/sagas/submitSendBoxSaga.js @@ -11,7 +11,7 @@ function* submitSendBox() { const sendBoxValue = yield select(sendBoxValueSelector); if (sendBoxValue) { - yield put(sendMessage(sendBoxValue, method)); + yield put(sendMessage(sendBoxValue.trim(), method)); yield put(setSendBox('')); } });