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

[Feature] ListTable.menu 右键菜单是否可以增加 blankAreaClickHidden、outsideClickHidden 配置项 #2033

Open
mzhang-eric opened this issue Jul 3, 2024 · 3 comments
Labels
feature 新需求 good first issue Good for newcomers

Comments

@mzhang-eric
Copy link

What problem does this feature solve?

ListTable 的右键菜单在显示之后,只有在表格绘制区域点击鼠标左键才会消失,能否增加在空白处点击、在外部点击时 右键菜单消失的配置项,类似于 ListTable.select 中的配置项:

const option = {
    select: {
      // 点击空白区域取消选中
      blankAreaClickDeselect: true,
      // 点击外部区域取消选中
      outsideClickDeselect: true,
    },
  };

What does the proposed API look like?

希望可以增加类似于 blankAreaClickHidden、outsideClickHidden 配置项:

const option = {
    menu: {
      blankAreaClickHidden: true,
      outsideClickHidden: true,
    },
  };
@mzhang-eric mzhang-eric added the feature 新需求 label Jul 3, 2024
@fangsmile
Copy link
Contributor

其实应该和下来菜单一样 点击其他位置消失就行 不用加配置
https://visactor.io/vtable/demo/component/dropdown

不过我们目前精力有限 如果有兴趣可以共享代码给我们 提pr

@fangsmile fangsmile added the good first issue Good for newcomers label Jul 4, 2024
@mzhang-eric
Copy link
Author

mzhang-eric commented Jul 5, 2024

其实应该和下来菜单一样 点击其他位置消失就行 不用加配置 https://visactor.io/vtable/demo/component/dropdown

不过我们目前精力有限 如果有兴趣可以共享代码给我们 提pr

点击其他位置消失,是想点击页面上表格之外的其他区域,或者画布空白,这些区域是在表格外面的,我在文档事件列表中看到的事情基本都是与表格内部单元格绑定的,比如点击双击,事件是发生在表格上的,但我现在要实现在表格之外点击隐藏右键菜单,是不是要自己使用原生的方法去监听鼠标左键单击事件,然后判定点击区域是否在表格外部,再通过表格api隐藏菜单?

我不知道上述理解是不是对的,我看了你给的下拉菜单的示例,里面提到的事件click_cell 等,都是表格上的事件。

另外有没有什么事件能让我知道自己点击的是表格绘制范围外的 canvas 空白区域?
文档中单元格选中这个配置项select.blankAreaClickDeselect 和 outsideClickDeselect ,这里的 blankArea 和 outside 在点击的时候是如何分辨区分的,这个能提供出来吗?

@mzhang-eric
Copy link
Author

我原来一直以为 select.outsideClickDeselect 是指表格组件以外,今天才明白原来这个外部指的是选中区域以外

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 新需求 good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants