Function
isCharacterKey
(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 | |
| 9 | function 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 | |
| 18 | export function EditableH1(props: { |
| 19 | text: string; |
Tested by
no test coverage detected