Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32507766
D6557.1767055282.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6557.1767055282.diff
View Options
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
@@ -23,7 +23,10 @@
threadActualMembers,
checkIfDefaultMembersAreVoiced,
} from 'lib/shared/thread-utils';
-import { getTypeaheadUserSuggestions } from 'lib/shared/typeahead-utils';
+import {
+ getTypeaheadUserSuggestions,
+ getTypeaheadRegexMatches,
+} from 'lib/shared/typeahead-utils';
import type { TypeaheadMatchedStrings } from 'lib/shared/typeahead-utils';
import type { CalendarQuery } from 'lib/types/entry-types';
import type { LoadingStatus } from 'lib/types/loading-types';
@@ -555,23 +558,17 @@
relativeMemberInfoSelectorForMembersOfThread(props.threadInfo.id),
);
- const inputSliceEndingAtCursor = React.useMemo(
- () =>
- props.inputState.draft.slice(0, props.inputState.textCursorPosition),
- [props.inputState.draft, props.inputState.textCursorPosition],
- );
- // we only try to match if there is end of text or whitespace after cursor
const typeaheadRegexMatches = React.useMemo(
() =>
- inputSliceEndingAtCursor.length === props.inputState.draft.length ||
- /\s/.test(props.inputState.draft[props.inputState.textCursorPosition])
- ? inputSliceEndingAtCursor.match(webTypeaheadRegex)
- : null,
- [
- inputSliceEndingAtCursor,
- props.inputState.textCursorPosition,
- props.inputState.draft,
- ],
+ getTypeaheadRegexMatches(
+ props.inputState.draft,
+ {
+ start: props.inputState.textCursorPosition,
+ end: props.inputState.textCursorPosition,
+ },
+ webTypeaheadRegex,
+ ),
+ [props.inputState.textCursorPosition, props.inputState.draft],
);
const typeaheadMatchedStrings: ?TypeaheadMatchedStrings = React.useMemo(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 30, 12:41 AM (10 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5866146
Default Alt Text
D6557.1767055282.diff (1 KB)
Attached To
Mode
D6557: [web] Hide typeahead if multiple characters are selected
Attached
Detach File
Event Timeline
Log In to Comment