aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/GlobalKeyHandler.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-08-30 13:55:41 -0400
committerbobzel <zzzman@gmail.com>2022-08-30 13:55:41 -0400
commit7f2556568ab635274c483d102fa4555d12e14835 (patch)
treea200eae31968fa2d2db119ddfded79042dfdcff0 /src/client/views/GlobalKeyHandler.ts
parent5dcf35a986bb1d9dbe6c26d0a7056ac43ceed007 (diff)
fixed loadingDocument issues with overwriting height with NaN and setting 'data' field unnecessarily and at the expense of being able to set it for replacement docs when using animation frames
Diffstat (limited to 'src/client/views/GlobalKeyHandler.ts')
-rw-r--r--src/client/views/GlobalKeyHandler.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts
index 88ce457c6..50518eec1 100644
--- a/src/client/views/GlobalKeyHandler.ts
+++ b/src/client/views/GlobalKeyHandler.ts
@@ -84,6 +84,7 @@ export class KeyManager {
});
private unmodified = action((keyname: string, e: KeyboardEvent) => {
+ const hasFffView = SelectionManager.Views().some(dv => dv.props.CollectionFreeFormDocumentView?.());
switch (keyname) {
case 'u':
if (document.activeElement?.tagName === 'INPUT' || document.activeElement?.tagName === 'TEXTAREA') {
@@ -160,16 +161,16 @@ export class KeyManager {
break;
case 'arrowleft':
UndoManager.RunInBatch(() => SelectionManager.Views().map(dv => dv.props.CollectionFreeFormDocumentView?.().nudge(-1, 0)), 'nudge left');
- return { stopPropagation: true, preventDefault: true };
+ return { stopPropagation: hasFffView, preventDefault: hasFffView };
case 'arrowright':
UndoManager.RunInBatch(() => SelectionManager.Views().map(dv => dv.props.CollectionFreeFormDocumentView?.().nudge?.(1, 0)), 'nudge right');
- return { stopPropagation: true, preventDefault: true };
+ return { stopPropagation: hasFffView, preventDefault: hasFffView };
case 'arrowup':
UndoManager.RunInBatch(() => SelectionManager.Views().map(dv => dv.props.CollectionFreeFormDocumentView?.().nudge?.(0, -1)), 'nudge up');
- return { stopPropagation: true, preventDefault: true };
+ return { stopPropagation: hasFffView, preventDefault: hasFffView };
case 'arrowdown':
UndoManager.RunInBatch(() => SelectionManager.Views().map(dv => dv.props.CollectionFreeFormDocumentView?.().nudge?.(0, 1)), 'nudge down');
- return { stopPropagation: true, preventDefault: true };
+ return { stopPropagation: hasFffView, preventDefault: hasFffView };
}
return {