Skip to content

Commit 5f3e18a

Browse files
committed
pass props to extra control
1 parent 8bd1969 commit 5f3e18a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

dist/react-simple-chatbot.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-simple-chatbot.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ChatBot.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,15 @@ class ChatBot extends Component {
632632
</Header>
633633
);
634634

635+
let customControl;
636+
if (extraControl !== undefined) {
637+
customControl = React.cloneElement(extraControl, {
638+
disabled,
639+
speaking,
640+
invalid: inputInvalid
641+
});
642+
}
643+
635644
const icon =
636645
(this.isInputValueEmpty() || speaking) && recognitionEnable ? <MicIcon /> : <SubmitIcon />;
637646

@@ -692,7 +701,7 @@ class ChatBot extends Component {
692701
/>
693702
)}
694703
<div style={controlStyle} className="rsc-controls">
695-
{!currentStep.hideInput && !currentStep.hideExtraControl && extraControl}
704+
{!currentStep.hideInput && !currentStep.hideExtraControl && customControl}
696705
{!currentStep.hideInput && !hideSubmitButton && (
697706
<SubmitButton
698707
className="rsc-submit-button"

0 commit comments

Comments
 (0)