File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ class ChatBot extends Component {
6464 const chatSteps = { } ;
6565
6666 const defaultBotSettings = { delay : botDelay , avatar : botAvatar } ;
67- const defaultUserSettings = { delay : userDelay , avatar : userAvatar } ;
67+ const defaultUserSettings = { delay : userDelay , avatar : userAvatar , hideInput : false } ;
6868 const defaultCustomSettings = { delay : customDelay } ;
6969
7070 for ( let i = 0 , len = steps . length ; i < len ; i += 1 ) {
@@ -108,7 +108,9 @@ class ChatBot extends Component {
108108 // focus input if last step cached is a user step
109109 this . setState ( { disabled : false } , ( ) => {
110110 if ( enableMobileAutoFocus || ! isMobile ( ) ) {
111- this . input . focus ( ) ;
111+ if ( this . input ) {
112+ this . input . focus ( ) ;
113+ }
112114 }
113115 } ) ;
114116 } ,
@@ -297,7 +299,9 @@ class ChatBot extends Component {
297299 if ( nextStep . user ) {
298300 this . setState ( { disabled : false } , ( ) => {
299301 if ( enableMobileAutoFocus || ! isMobile ( ) ) {
300- this . input . focus ( ) ;
302+ if ( this . input ) {
303+ this . input . focus ( ) ;
304+ }
301305 }
302306 } ) ;
303307 } else {
@@ -461,7 +465,9 @@ class ChatBot extends Component {
461465 inputValue : '' ,
462466 } ,
463467 ( ) => {
464- this . input . blur ( ) ;
468+ if ( this . input ) {
469+ this . input . blur ( ) ;
470+ }
465471 } ,
466472 ) ;
467473 }
@@ -490,7 +496,9 @@ class ChatBot extends Component {
490496 } ,
491497 ( ) => {
492498 if ( enableMobileAutoFocus || ! isMobile ( ) ) {
493- this . input . focus ( ) ;
499+ if ( this . input ) {
500+ this . input . focus ( ) ;
501+ }
494502 }
495503 } ,
496504 ) ;
You can’t perform that action at this time.
0 commit comments