Comments (5)
不管 Windows 还是 Mac,好像都没法阻止默认的右键弹窗~
[
S2Event.GLOBAL_SCROLL,
S2Event.ROW_CELL_CLICK,
S2Event.COL_CELL_CLICK,
S2Event.CORNER_CELL_CLICK,
S2Event.DATA_CELL_CLICK,
S2Event.GLOBAL_SELECTED,
S2Event.DATA_CELL_BRUSH_SELECTION,
S2Event.LAYOUT_RESIZE,
S2Event.GLOBAL_CONTEXT_MENU,
].forEach((eventName) => {
s2.on(eventName, event => {
if (eventName === S2Event.GLOBAL_CONTEXT_MENU) {
// 没有效果
event.preventDefault();
event.stopPropagation();
// 这样也没有效果
event.originalEvent.preventDefault();
event.originalEvent.stopPropagation();
}
});
});
from s2.
不管 Windows 还是 Mac,好像都没法阻止默认的右键弹窗~
[ S2Event.GLOBAL_SCROLL, S2Event.ROW_CELL_CLICK, S2Event.COL_CELL_CLICK, S2Event.CORNER_CELL_CLICK, S2Event.DATA_CELL_CLICK, S2Event.GLOBAL_SELECTED, S2Event.DATA_CELL_BRUSH_SELECTION, S2Event.LAYOUT_RESIZE, S2Event.GLOBAL_CONTEXT_MENU, ].forEach((eventName) => { s2.on(eventName, event => { if (eventName === S2Event.GLOBAL_CONTEXT_MENU) { // 没有效果 event.preventDefault(); event.stopPropagation(); // 这样也没有效果 event.originalEvent.preventDefault(); event.originalEvent.stopPropagation(); } }); });
2.0 版本右键事件使用的 G 的 rightdown/rightup
, 默认事件并不是右键菜单 (具体可以参考G 文档), 所以 preventDefault
无效, 需要这样写, 需要监听 <canvas/>
DOM 元素, 后面补充下文档
s2.getCanvasElement().addEventListener('contextmenu', (event) => {
event.preventDefault();
});
from s2.
你好 @XiChaoMing,很抱歉给你带来了不好的体验, 我们会尽快排查问题并修复, 请关注后续发布日志.
Hello, @XiChaoMing, We are so sorry for the bad experience. We will troubleshoot and fix the problem as soon as possible. Please pay attention to the follow-up change logs.
from s2.
🎉 This issue has been resolved in version @antv/s2-v2.0.0-next.19 🎉
The release is available on:
Your semantic-release bot 📦🚀
from s2.
🎉 This issue has been resolved in version @antv/s2-react-v2.0.0-next.18 🎉
The release is available on:
Your semantic-release bot 📦🚀
from s2.
Related Issues (20)
- 🙏滚动条增加hover的动作的易用性建议 HOT 1
- 🐛 明细表设置了 themeCfg 之后,操作单元格会出现卡顿问题
- 🐛 s2 v1 版本文档打开白屏 HOT 1
- 🐛 s2 v1 版本文档打开白屏 HOT 1
- 🐛 G2 图表的单元格显示 tooltip 会抛出 Error
- 🐛 交叉表自定义列头导出数据格式错位 HOT 1
- 🤔 自定义单元格时遇到的问题 ViewMeta.data 和1.x数据不一致,文档描述也没变
- 设置cellTextWordWrapStyle 展示多行,点击表格td,只有第一横行点击会选中这个td,tooltip才会展示 HOT 2
- 🤔S2透视表的值数据单元格区域每个单元格能自定义聚合方式吗? HOT 1
- 🐛S2父级及以上的节点,添加了transform: scale(1.1)后,透视表分组排序按钮失效 HOT 1
- 使用SheetComponent的透视表。怎么点击行头,拿到当前一整行的数据呢?包括列头。 HOT 1
- 🐛Meta in merged cell was unpredicted because of unsorted cellInfos
- 导出数据只要数据的内容中含有,逗号的就会按逗号分隔显示在多个单元格中 HOT 2
- 🐛导出数据只要数据内容带,逗号的 在excel中就会按逗号拆分显示成多个单元格
- 🐛移动端 图表滑动到边缘 页面滚动条无法滚动 HOT 1
- S2明细表鼠标悬停每行上面,去掉下边框🤔 HOT 2
- 🤔 图表只渲染了表头信息,具体内容值信息没渲染? HOT 2
- antv [email protected] 使用customTree 目录树时,想通过conditions配置表头的样式,使用后发现,插件内部生成的row【指标】这一格无法修改,利用什么属性可以修改 HOT 1
- 🤔S2明细表在使用tooltip 对dataCell自定义时 抛出异常!
- 🤔S2明细表修改单元格的样式 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s2.