MCPcopy Create free account
hub / github.com/dailydotdev/apps / onKeyUp

Function onKeyUp

packages/shared/src/hooks/input/useMarkdownInput.ts:428–442  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

426 };
427
428 const onKeyUp: KeyboardEventHandler<HTMLTextAreaElement> = (e) => {
429 const pressed = e.key as ArrowKey;
430
431 if (!arrowKeys.includes(pressed)) {
432 return;
433 }
434
435 if (Y_AXIS_KEYS.includes(pressed) && mentions?.length) {
436 return;
437 }
438
439 const { selectionStart, selectionEnd } = e.currentTarget;
440 checkMention([selectionStart, selectionEnd]);
441 checkEmoji([selectionStart, selectionEnd]);
442 };
443
444 const onKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = async (e) => {
445 const isSpecialKey = e.ctrlKey || e.metaKey;

Callers

nothing calls this directly

Calls 2

checkMentionFunction · 0.85
checkEmojiFunction · 0.85

Tested by

no test coverage detected