MCPcopy Index your code
hub / github.com/srcbookdev/srcbook / isCharacterKey

Function isCharacterKey

packages/components/src/components/ui/heading.tsx:9–16  ·  view source on GitHub ↗
(e: React.KeyboardEvent<HTMLHeadingElement>)

Source from the content-addressed store, hash-verified

7 'flex w-full whitespace-normal rounded-md border border-transparent bg-transparent px-1 py-1 transition-colors hover:border-input hover:shadow-sm focus-visible:shadow-md focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50';
8
9function isCharacterKey(e: React.KeyboardEvent<HTMLHeadingElement>) {
10 return (
11 e.key.length === 1 && // This checks if the pressed key is a single character
12 !e.ctrlKey &&
13 !e.metaKey &&
14 !e.altKey
15 );
16}
17
18export function EditableH1(props: {
19 text: string;

Callers 1

EditableH1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected