aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GlobalKeyHandler.ts
diff options
context:
space:
mode:
authoreleanor-park <eleanor_park@brown.edu>2025-01-14 17:25:47 +0100
committereleanor-park <eleanor_park@brown.edu>2025-01-14 17:25:47 +0100
commit85f60319ba7020b2976ed1063915a145a09ab381 (patch)
tree60a1c2270717ff4a5e89fd079bdad1ad139ca4f7 /src/client/views/GlobalKeyHandler.ts
parent859bb1b733901e4697f1d53781af725e4830c607 (diff)
parent12f5a435ee6476e2e07ded0c9cdd597c70ca8af0 (diff)
Merge branch 'eleanor-gptdraw' of https://github.com/brown-dash/Dash-Web into eleanor-gptdraw
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
-rw-r--r--src/client/views/GlobalKeyHandler.ts8
1 files changed, 4 insertions, 4 deletions
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