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

多选节点目前不支持ctrl,只支持meta, alt, shift #836

Closed
wangzhengbo opened this issue Oct 27, 2022 · 7 comments
Closed

多选节点目前不支持ctrl,只支持meta, alt, shift #836

wangzhengbo opened this issue Oct 27, 2022 · 7 comments

Comments

@wangzhengbo
Copy link

目前多选节点只支持multipleSelectKey设置为meta, alt, shift,但是项目有需求要求使用ctrl快捷键。看logicflow源码中注释说ctrl会触发contextmenu,没有看到哪里使用了ctrl来触发contextmenu

@wangzhengbo
Copy link
Author

我修改源码,改成ctrl,发现ctrl是可以用的,没有碰到其它副作用。请问代码中下面的注释中提到的原因是啥情况?

/**

  • 多选按键, 支持meta(cmd)、shift、alt
  • 不支持ctrl,ctrl会触发contextmenu
    */
    multipleSelectKey?: string;

@towersxu
Copy link
Collaborator

towersxu commented Oct 28, 2022

这个是浏览的默认行为,你可以任何按下ctrl + 左键,都表现出点击鼠标右键的表现。为了不影响这个默认行为,所以才没有支持ctrl。因为如果支持了,多选会触发节点的右键点击事件,如果我们基于右键点击做了线上菜单这类操作,就会出现多选时也出现菜单。

@wangzhengbo
Copy link
Author

这个是浏览的默认行为,你可以任何按下ctrl + 左键,都表现出点击鼠标右键的表现。为了不影响这个默认行为,所以才没有支持ctrl。因为如果支持了,多选会触发节点的右键点击事件,如果我们基于右键点击做了线上菜单这类操作,就会出现多选时也出现菜单。

我试了没碰到这种情况哦。Chrome下按住Ctrl + 左键点击节点,没有触发节点的contextmenu事件。

@wangzhengbo
Copy link
Author

Mac上确实是这样的

@wangzhengbo
Copy link
Author

我想在Mac上支持meta,Windows上支持ctrl(Windows上没有ctrl + 点击触发上下文菜单的问题)。但是LogicFlow限制不能用ctrl,请问这个限制能放开吗?

@towersxu
Copy link
Collaborator

这样的话确实可以放开,下个版本我加一下这个功能。

@towersxu
Copy link
Collaborator

FIXED #870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants