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】设置禁用拖拽效果,键盘事件仍生效 #521

Closed
joey127yao opened this issue Jul 6, 2023 · 1 comment
Closed

【BUG】设置禁用拖拽效果,键盘事件仍生效 #521

joey127yao opened this issue Jul 6, 2023 · 1 comment

Comments

@joey127yao
Copy link

moveableOptions.draggable 配置不允许拖拽
现状:
鼠标不可以拖动,但可以通过键盘的方向键进行方位调整,并触发了属性的方位修改。
期望:
方位属性值键盘事件不生效

@jia000
Copy link
Collaborator

jia000 commented Jul 6, 2023

更新到 v1.2.0-alpha.10

然后加上如下代码

editorService.usePlugin({
  beforeDoUpdate(config: MNode) {
    const stage = editorService.get('stage');
    if (!stage?.getMoveableOption('draggable') && config.style) {
      delete config.style.left;
      delete config.style.top;
      delete config.style.right;
      delete config.style.bottom;
    }
    return [config];
  },
});

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