From 12f5a435ee6476e2e07ded0c9cdd597c70ca8af0 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 13 Jan 2025 22:26:35 -0500 Subject: changing ai for images and collections to work mostly the same way. fixes for document view/collection/images to keep things working when the ai editor view reduces the rendered document size. fixed so that freeform views overlaid on images/vieos/etc have the ui menu items of collections. --- src/client/views/GlobalKeyHandler.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/views/GlobalKeyHandler.ts') diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts index f16338361..b200aff65 100644 --- a/src/client/views/GlobalKeyHandler.ts +++ b/src/client/views/GlobalKeyHandler.ts @@ -169,10 +169,10 @@ export class KeyManager { return { stopPropagation: true, preventDefault: true }; } break; - case 'arrowleft': return this.nudge(-1,0, 'nudge left') - case 'arrowright': return this.nudge(1,0, 'nudge right'); - case 'arrowup': return this.nudge(0, -1, 'nudge up'); - case 'arrowdown': return this.nudge(0, 1, 'nudge down'); + case 'arrowleft': return (e.target as any).type !== 'text' && this.nudge(-1, 0, 'nudge left') // if target is an input box, then we don't want to nudge any Docs since we're justing moving within the text itself. + case 'arrowright': return (e.target as any).type !== 'text' && this.nudge( 1, 0, 'nudge right'); + case 'arrowup': return (e.target as any).type !== 'text' && this.nudge(0, -1, 'nudge up'); + case 'arrowdown': return (e.target as any).type !== 'text' && this.nudge(0, 1, 'nudge down'); default: } // prettier-ignore -- cgit v1.2.3-70-g09d2