mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
12360 Notebook UI - Mac/Win fix for Select all. (#12383)
* 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>
This commit is contained in:
@@ -67,18 +67,19 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
|||||||
this.enableActiveCellEditOnDoubleClick();
|
this.enableActiveCellEditOnDoubleClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('document:keydown.meta.a', ['$event'])
|
@HostListener('document:keydown', ['$event'])
|
||||||
onkeydown(e) {
|
onkeydown(e) {
|
||||||
// use preventDefault() to avoid invoking the editor's select all
|
// use preventDefault() to avoid invoking the editor's select all
|
||||||
// select the active .
|
// select the active .
|
||||||
|
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
document.execCommand('selectAll');
|
document.execCommand('selectAll');
|
||||||
}
|
}
|
||||||
|
if ((e.ctrlKey || e.metaKey) && e.key === 'z') {
|
||||||
@HostListener('document:keydown.meta.z', ['$event'])
|
e.preventDefault();
|
||||||
onUndo(e) {
|
|
||||||
document.execCommand('undo');
|
document.execCommand('undo');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private _content: string | string[];
|
private _content: string | string[];
|
||||||
private _lastTrustedMode: boolean;
|
private _lastTrustedMode: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user