diff --git a/pkg/interface/src/views/apps/chat/components/ChatInput.tsx b/pkg/interface/src/views/apps/chat/components/ChatInput.tsx index 353ce44ab..403ef6427 100644 --- a/pkg/interface/src/views/apps/chat/components/ChatInput.tsx +++ b/pkg/interface/src/views/apps/chat/components/ChatInput.tsx @@ -44,7 +44,7 @@ class ChatInput extends Component { inCodeMode: false, submitFocus: false, uploadingPaste: false, - currentInput: props.message, + currentInput: props.message }; this.chatEditor = React.createRef(); @@ -124,10 +124,6 @@ class ChatInput extends Component { .catch(this.uploadError); }); } - - toggleFocus(value) { - this.setState({ submitFocus: value }); - } eventHandler(value) { this.setState({ currentInput: value }); @@ -194,8 +190,6 @@ class ChatInput extends Component { onUnmount={props.onUnmount} message={props.message} onPaste={this.onPaste.bind(this)} - focusEvent={() => this.toggleFocus(true)} - blurEvent={() => this.toggleFocus(false)} changeEvent={this.eventHandler} placeholder='Message...' /> @@ -224,9 +218,7 @@ class ChatInput extends Component { ) ) : null} - {(MOBILE_BROWSER_REGEX.test(navigator.userAgent) && - state.submitFocus) || - state.currentInput !== "" ? ( + {MOBILE_BROWSER_REGEX.test(navigator.userAgent) ? { width="24px" height="24px" borderRadius="50%" - backgroundColor={state.currentInput !== "" ? "blue" : "gray"} - cursor={state.currentInput !== "" ? "pointer" : "default"} + backgroundColor={state.currentInput !== '' ? 'blue' : 'gray'} + cursor={state.currentInput !== '' ? 'pointer' : 'default'} onClick={() => this.chatEditor.current.submit()} > - ) : null} + : null} ); } diff --git a/pkg/interface/src/views/apps/chat/components/chat-editor.js b/pkg/interface/src/views/apps/chat/components/chat-editor.js index fb64ef0b5..3fbf94226 100644 --- a/pkg/interface/src/views/apps/chat/components/chat-editor.js +++ b/pkg/interface/src/views/apps/chat/components/chat-editor.js @@ -181,8 +181,6 @@ export default class ChatEditor extends Component { inCodeMode, placeholder, message, - focusEvent, - blurEvent, ...props } = this.props; @@ -242,8 +240,6 @@ export default class ChatEditor extends Component { rows="1" style={{ width: '100%', background: 'transparent', color: 'currentColor' }} placeholder={inCodeMode ? "Code..." : "Message..."} - onFocus={focusEvent} - onBlur={blurEvent} onChange={event => { this.messageChange(null, null, event.target.value); }} @@ -271,8 +267,6 @@ export default class ChatEditor extends Component { this.editor = editor; editor.focus(); }} - onFocus={focusEvent} - onBlur={blurEvent} {...props} /> }