add quick shortcut emoji feature and tests
Signed-off-by: macekj <macekj@umich.edu>
This commit is contained in:
parent
8eadf6b183
commit
ba8d02a808
5 changed files with 107 additions and 6 deletions
|
@ -47,7 +47,7 @@ import AutocompleteWrapperModel from "../../../editor/autocomplete";
|
|||
import DocumentPosition from "../../../editor/position";
|
||||
import {ICompletion} from "../../../autocomplete/Autocompleter";
|
||||
|
||||
const REGEX_EMOTICON_WHITESPACE = new RegExp('(?:^|\\s)(' + EMOTICON_REGEX.source + ')\\s$');
|
||||
const REGEX_EMOTICON_WHITESPACE = new RegExp('(?:^|\\s|(?<=^\\+))(' + EMOTICON_REGEX.source + ')\\s$');
|
||||
|
||||
const IS_MAC = navigator.platform.indexOf("Mac") !== -1;
|
||||
|
||||
|
@ -524,7 +524,7 @@ export default class BasicMessageEditor extends React.Component<IProps, IState>
|
|||
const position = model.positionForOffset(caret.offset, caret.atNodeEnd);
|
||||
const range = model.startRange(position);
|
||||
range.expandBackwardsWhile((index, offset, part) => {
|
||||
return part.text[offset] !== " " && (
|
||||
return part.text[offset] !== " " && part.text[offset] !== "+" && (
|
||||
part.type === "plain" ||
|
||||
part.type === "pill-candidate" ||
|
||||
part.type === "command"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue