Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report]: updateEditConfig 切换 isSilentMode 状态,keyboard 失效 #1460

Closed
cathats opened this issue Dec 18, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@cathats
Copy link

cathats commented Dec 18, 2023

发生了什么?

我是用 keyboard 定义了删除连线(edge)的操作。

初始化时,我将 isSilentMode 设置为 true,同时添加了自定义 keyboard 事件。
当用户点击「编辑按钮」时将其设置为 false(利用了 updateEditConfig)。但是这一操作导致自定义 keyboard 失效。

下面是一个简化的问题代码,其中 setTimeout 模拟了用户点击按钮切换 isSilentMode 的操作。
preview:https://codesandbox.io/p/sandbox/logicflow-demo-1-rttryj

logicflow/core版本

1.2.18

logicflow/extension版本

1.2.19

logicflow/engine版本

No response

浏览器&环境

Chrome

@cathats cathats added the bug Something isn't working label Dec 18, 2023
@wumail
Copy link
Collaborator

wumail commented Dec 18, 2023

image

@towersxu
Copy link
Collaborator

看起来是有点问题,静默模式应该只禁用内置的快捷键,不禁用自定义的。

if (!this.options.isSilentMode) {
// 先初始化默认内置快捷键
initDefaultShortcut(this, this.graphModel);
// 然后再初始化自定义快捷键,自定义快捷键可以覆盖默认快捷键.
// 插件最后初始化。方便插件强制覆盖内置快捷键
this.keyboard.initShortcuts();
}

可以试试手动再调用一次lf.keyboard.initShortcuts(),是否能临时解决这个问题。

@boyongjiong
Copy link
Collaborator

#1491 已发版修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants