RED-5889: Fixed ctrl+f and command+f not opening pdf search & cleanup.
This commit is contained in:
parent
2db9fe67f4
commit
359fe585ee
@ -140,6 +140,12 @@ export class FilePreviewScreenComponent
|
||||
this.fullScreen = false;
|
||||
}
|
||||
});
|
||||
|
||||
this.pdf.instance.UI.hotkeys.on('command+f, ctrl+f', e => {
|
||||
e.preventDefault();
|
||||
this.pdf.focusSearch();
|
||||
this.pdf.activateSearch();
|
||||
});
|
||||
}
|
||||
|
||||
get changed() {
|
||||
@ -360,7 +366,6 @@ export class FilePreviewScreenComponent
|
||||
this.closeFullScreen();
|
||||
this.pdf.deactivateSearch();
|
||||
this._changeRef.markForCheck();
|
||||
window.focus();
|
||||
}
|
||||
|
||||
if (['f', 'F'].includes($event.key)) {
|
||||
@ -368,12 +373,6 @@ export class FilePreviewScreenComponent
|
||||
if ($event.target instanceof HTMLInputElement || $event.target instanceof HTMLTextAreaElement) {
|
||||
return;
|
||||
}
|
||||
if ($event.ctrlKey) {
|
||||
this.pdf.focusSearch();
|
||||
this.pdf.activateSearch();
|
||||
return;
|
||||
}
|
||||
|
||||
this.toggleFullScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -67,13 +67,7 @@ export class REDDocumentViewer {
|
||||
}
|
||||
return ($event.target as HTMLElement)?.tagName?.toLowerCase() !== 'input';
|
||||
}),
|
||||
filter(
|
||||
$event =>
|
||||
$event.key.startsWith('Arrow') ||
|
||||
$event.key === 'f' ||
|
||||
['h', 'H'].includes($event.key) ||
|
||||
['Escape'].includes($event.key),
|
||||
),
|
||||
filter($event => $event.key.startsWith('Arrow') || ['f', 'h', 'H', 'Escape'].includes($event.key)),
|
||||
tap<KeyboardEvent>(stopAndPrevent),
|
||||
log('[PDF] Keyboard shortcut'),
|
||||
);
|
||||
|
||||
@ -68,6 +68,7 @@ export const DISABLED_HOTKEYS = [
|
||||
'CTRL+P',
|
||||
'COMMAND+P',
|
||||
'CTRL+F',
|
||||
'COMMAND+F',
|
||||
'SPACE',
|
||||
'UP',
|
||||
'DOWN',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user