MCPcopy Index your code
hub / github.com/primer/react / handler

Function handler

packages/react/src/drafts/MarkdownEditor/MarkdownEditor.tsx:325–337  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

323 editorsInPreviewMode.push(id)
324
325 const handler = (e: KeyboardEvent) => {
326 if (
327 !e.defaultPrevented &&
328 editorsInPreviewMode.at(-1) === id &&
329 isModifierKey(e) &&
330 e.shiftKey &&
331 e.key === 'p'
332 ) {
333 setView?.('edit')
334 setTimeout(() => inputRef.current?.focus())
335 e.preventDefault()
336 }
337 }
338 document.addEventListener('keydown', handler)
339
340 return () => {

Callers

nothing calls this directly

Calls 1

isModifierKeyFunction · 0.90

Tested by

no test coverage detected