Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/chatInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ type Props = {
threadData?: Object,
refetchThread?: Function,
quotedMessage: ?{ messageId: string, threadId: string },
onFocus: ?Function,
onBlur: ?Function,
};

// $FlowFixMe
Expand Down Expand Up @@ -333,6 +335,8 @@ const ChatInput = (props: Props) => {
networkDisabled={networkDisabled}
placeholder="Your message here..."
value={text}
onFocus={props.onFocus}
onBlur={props.onBlur}
onChange={onChange}
onKeyDown={handleKeyPress}
inputRef={node => {
Expand Down
7 changes: 6 additions & 1 deletion src/views/directMessages/containers/newThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ class NewThread extends React.Component<Props, State> {
handleKeyPress = (e: any) => {
// if the thread slider is open, we shouldn't be doing anything in DMs
if (this.props.threadSliderIsOpen) return;
if (this.state.chatInputIsFocused) return;

// destructure the whole state object
const {
Expand Down Expand Up @@ -412,7 +413,11 @@ class NewThread extends React.Component<Props, State> {
};

handleChange = (e: any) => {
const { existingThreadBasedOnSelectedUsers } = this.state;
const {
existingThreadBasedOnSelectedUsers,
chatInputIsFocused,
} = this.state;
if (chatInputIsFocused) return;

// unfocus any selected user pills
this.setState({
Expand Down