leaferjs / leafer-ui

一款好用的 Canvas 引擎,革新的开发体验,用于高效绘图 、UI 交互、图形编辑。A user-friendly Canvas engine with a revolutionary development experience, for efficient drawing, UI interactions, and graphic editing.
https://www.leaferjs.com
MIT License
2.52k stars 89 forks source link

[bug] 在处理KeyEvent时修改编辑器选择项时出错 #251

Open Ronbb opened 1 week ago

Ronbb commented 1 week ago
  1. app 监听 KeyEvent.DOWN,按下时删除已经选择的元素并取消选择(不取消的话 选择框还在)
  2. 选择一个元素并按下Delete时控制台报错:

参考:

this.app.on(KeyEvent.DOWN, () => {
    app.editor.list.forEach((element) => {
      element.remove();
    });

    app.editor.select([]);
}
leaferjs commented 1 week ago

收到,谢谢反馈,后面优化一下~