forked from github/dataease
Merge pull request #4201 from dataease/pr@dev@fix_shortkey-multiple
refactor(仪表板): 优化编辑界面复用功能键盘监听,防止关闭复用界面导致键盘监听事件失效
This commit is contained in:
commit
4fffb2044a
@ -413,7 +413,8 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.canvasId === 'canvas-main') {
|
||||
// 防止编辑界面销毁键盘事件监听
|
||||
if (this.canvasId === 'canvas-main' && !this.showPosition.includes('multiplexing')) {
|
||||
listenGlobalKeyDownPreview()
|
||||
}
|
||||
// 取消视图请求
|
||||
|
@ -74,6 +74,8 @@ export function listenGlobalKeyDown() {
|
||||
export function listenGlobalKeyDownPreview() {
|
||||
window.onkeydown = (e) => {
|
||||
const { keyCode } = e
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
if (keyCode === ctrlKey || keyCode === commandKey) {
|
||||
isCtrlOrCommandDown = true
|
||||
} else if (isCtrlOrCommandDown) {
|
||||
|
Loading…
Reference in New Issue
Block a user