mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 17:23:31 -05:00
* 12360 Notebook UI - Mac/Win fix for Select all. * Fix for ctrl key selecting all in windows * Fix undo as well * preventDefault to prevent confusing behavior Co-authored-by: chlafreniere <hichise@gmail.com> Co-authored-by: chlafreniere <hichise@gmail.com>
This commit is contained in:
@@ -67,17 +67,18 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
||||
this.enableActiveCellEditOnDoubleClick();
|
||||
}
|
||||
|
||||
@HostListener('document:keydown.meta.a', ['$event'])
|
||||
@HostListener('document:keydown', ['$event'])
|
||||
onkeydown(e) {
|
||||
// use preventDefault() to avoid invoking the editor's select all
|
||||
// select the active .
|
||||
e.preventDefault();
|
||||
document.execCommand('selectAll');
|
||||
}
|
||||
|
||||
@HostListener('document:keydown.meta.z', ['$event'])
|
||||
onUndo(e) {
|
||||
document.execCommand('undo');
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
||||
e.preventDefault();
|
||||
document.execCommand('selectAll');
|
||||
}
|
||||
if ((e.ctrlKey || e.metaKey) && e.key === 'z') {
|
||||
e.preventDefault();
|
||||
document.execCommand('undo');
|
||||
}
|
||||
}
|
||||
|
||||
private _content: string | string[];
|
||||
|
||||
Reference in New Issue
Block a user