Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3357584
D6044.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6044.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
@@ -51,9 +51,10 @@
import { useSelector } from '../redux/redux-utils';
import { nonThreadCalendarQuery } from '../selectors/nav-selectors';
import SWMansionIcon from '../SWMansionIcon.react';
-import { typeaheadRegex } from '../utils/typeahead-utils';
+import { webTypeaheadRegex } from '../utils/typeahead-utils';
import css from './chat-input-bar.css';
import TypeaheadTooltip from './typeahead-tooltip.react';
+
type BaseProps = {
+threadInfo: ThreadInfo,
+inputState: InputState,
@@ -534,7 +535,7 @@
() =>
inputSliceEndingAtCursor.length === props.inputState.draft.length ||
/\s/.test(props.inputState.draft[props.inputState.textCursorPosition])
- ? inputSliceEndingAtCursor.match(typeaheadRegex)
+ ? inputSliceEndingAtCursor.match(webTypeaheadRegex)
: null,
[
inputSliceEndingAtCursor,
diff --git a/web/utils/typeahead-utils.js b/web/utils/typeahead-utils.js
--- a/web/utils/typeahead-utils.js
+++ b/web/utils/typeahead-utils.js
@@ -9,7 +9,7 @@
import { typeaheadStyle } from '../chat/chat-constants';
import { type InputState } from '../input/input-state';
-const typeaheadRegex: RegExp = new RegExp(
+const webTypeaheadRegex: RegExp = new RegExp(
`(?<textPrefix>(?:^(?:.|\n)*\\s+)|^)@(?<username>${oldValidUsernameRegexString})?$`,
);
@@ -136,7 +136,7 @@
}
export {
- typeaheadRegex,
+ webTypeaheadRegex,
getCaretOffsets,
getTypeaheadTooltipActions,
getTypeaheadTooltipPosition,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 12:24 AM (21 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2577793
Default Alt Text
D6044.diff (1 KB)
Attached To
Mode
D6044: [web] Keyboard support for typeahead [4/13] - Renamed regex
Attached
Detach File
Event Timeline
Log In to Comment