20 lines · 633 B · TypeScript
RawDownload
import { useCallback, useState } from "react"; export function useComposerFocusState() {  const [isComposerFocused, setIsComposerFocused] = useState(false);  const [isComposerScrollCollapsed, setIsComposerScrollCollapsed] = useState(false);   // Reaching the end of the timeline lifts a scroll collapse without moving  // DOM focus to the editor.  const restoreAfterTimelineReachedEnd = useCallback(() => {    setIsComposerScrollCollapsed(false);  }, []);   return {    isComposerFocused,    setIsComposerFocused,    isComposerScrollCollapsed,    setIsComposerScrollCollapsed,    restoreAfterTimelineReachedEnd,  };}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t