fix: allow spacebar in contentEditable elements (markdown editor)
Space-to-pan handler was intercepting spacebar globally but only excluded INPUT/TEXTAREA — missed contentEditable (BlockNote editor).
This commit is contained in:
@@ -460,7 +460,8 @@ const PixiCanvas = forwardRef<PixiCanvasHandle, PixiCanvasProps>(
|
||||
useEffect(() => {
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.code !== 'Space' || spaceHeld.current) return;
|
||||
if ((e.target as HTMLElement)?.tagName === 'INPUT' || (e.target as HTMLElement)?.tagName === 'TEXTAREA') return;
|
||||
const t = e.target as HTMLElement | null;
|
||||
if (t?.tagName === 'INPUT' || t?.tagName === 'TEXTAREA' || t?.isContentEditable) return;
|
||||
|
||||
spaceHeld.current = true;
|
||||
const vp = viewportRef.current;
|
||||
|
||||
Reference in New Issue
Block a user