diff --git a/web/chat/chat-input-bar.react.js b/web/chat/chat-input-bar.react.js --- a/web/chat/chat-input-bar.react.js +++ b/web/chat/chat-input-bar.react.js @@ -156,6 +156,20 @@ 'none', ); } + + if ( + this.props.suggestedUsers.length === 0 && + this.props.inputState.typeaheadState.frozenSuggestedUsers.length !== 0 + ) { + this.props.inputState.setTypeaheadState({ frozenSuggestedUsers: [] }); + } else if ( + this.props.suggestedUsers.length !== 0 && + this.props.inputState.typeaheadState.frozenSuggestedUsers.length === 0 + ) { + this.props.inputState.setTypeaheadState({ + frozenSuggestedUsers: this.props.suggestedUsers, + }); + } } static unassignedUploadIDs( @@ -350,7 +364,9 @@ inputState={this.props.inputState} textarea={this.textarea} matchedStrings={this.props.typeaheadMatchedStrings} - suggestedUsers={this.props.suggestedUsers} + suggestedUsers={ + this.props.inputState.typeaheadState.frozenSuggestedUsers + } /> ); } diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js --- a/web/input/input-state-container.react.js +++ b/web/input/input-state-container.react.js @@ -144,6 +144,7 @@ textCursorPositions: {}, typeaheadState: { canBeVisible: false, + frozenSuggestedUsers: [], moveChoiceUp: null, moveChoiceDown: null, close: null, diff --git a/web/input/input-state.js b/web/input/input-state.js --- a/web/input/input-state.js +++ b/web/input/input-state.js @@ -8,7 +8,7 @@ type MediaMissionStep, } from 'lib/types/media-types'; import type { RawTextMessageInfo } from 'lib/types/messages/text'; -import type { ThreadInfo } from 'lib/types/thread-types'; +import type { ThreadInfo, RelativeMemberInfo } from 'lib/types/thread-types'; export type PendingMultimediaUpload = { localID: string, @@ -36,6 +36,7 @@ export type TypeaheadState = { +canBeVisible: boolean, + +frozenSuggestedUsers: $ReadOnlyArray, +moveChoiceUp: ?() => void, +moveChoiceDown: ?() => void, +close: ?() => void,