mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-11 18:36:03 +00:00
Merge branch 'fix/hotkey' into 'release/0.9.1'
fix: 增加try catch See merge request !911457
This commit is contained in:
commit
8a701c0c0d
@ -328,6 +328,7 @@ function getKeyInfo(combination: string, action?: string): KeyInfo {
|
|||||||
* convention - prevent default and stop propogation on the event
|
* convention - prevent default and stop propogation on the event
|
||||||
*/
|
*/
|
||||||
function fireCallback(callback: HotkeyCallback, e: KeyboardEvent, combo?: string, sequence?: string): void {
|
function fireCallback(callback: HotkeyCallback, e: KeyboardEvent, combo?: string, sequence?: string): void {
|
||||||
|
try {
|
||||||
const editor = globalContext.get(Editor);
|
const editor = globalContext.get(Editor);
|
||||||
const designer = editor.get('designer');
|
const designer = editor.get('designer');
|
||||||
const node = designer?.currentSelection?.getNodes()?.[0];
|
const node = designer?.currentSelection?.getNodes()?.[0];
|
||||||
@ -345,6 +346,9 @@ function fireCallback(callback: HotkeyCallback, e: KeyboardEvent, combo?: string
|
|||||||
sequence,
|
sequence,
|
||||||
selected,
|
selected,
|
||||||
});
|
});
|
||||||
|
} catch(err) {
|
||||||
|
console.error(err.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Hotkey {
|
export class Hotkey {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user