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:
Hiren Kangad
2026-03-15 13:15:00 +05:30
parent 479feb991c
commit 019e17ae59
+2 -1
View File
@@ -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;