VTable
VTable copied to clipboard
[Bug] 同时设置 checkbox 以及表列拖拽时,按住 checkbox 也能拖拽
Version
1.16.1
Link to Minimal Reproduction
https://www.visactor.io/vtable/demo/cell-type/checkbox
Steps to Reproduce
同时设置 options.select.disableSelect = true 以及 options.dragHeaderMode = 'column' 即可稳定复现该问题(不设置 options.select.disableSelect = true 也可以复现,只不过操作起来要求更高一些),完整复现代码如下:
const records = [
{ productName: 'aaaa', price: 20, check: { text: 'unchecked', checked: false, disable: false } },
{ productName: 'bbbb', price: 18, check: { text: 'checked', checked: true, disable: false } },
{ productName: 'cccc', price: 16, check: { text: 'disable', checked: true, disable: true } },
{ productName: 'cccc', price: 14, check: { text: 'disable', checked: false, disable: true } },
{ productName: 'eeee', price: 12, check: { text: 'checked', checked: false, disable: false } },
{ productName: 'ffff', price: 10, check: { text: 'checked', checked: false, disable: false } },
{ productName: 'gggg', price: 10, check: { text: 'checked', checked: false, disable: false } }
];
const columns = [
{
field: 'isCheck',
title: '',
width: 60,
headerType: 'checkbox',
cellType: 'checkbox'
},
{
field: 'productName',
title: 'productName',
width: 120
},
];
const option = {
records,
columns,
select: {
disableSelect: true,
},
dragHeaderMode: 'column',
};
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
tableInstance.on('checkbox_state_change', console.log)
window['tableInstance'] = tableInstance;
Current Behavior
如标题
Expected Behavior
在按下 checkbox 的时候不触发拖拽行为,只有按下空白的区域时才触发(其他类型的表列也应该按照此类逻辑,例如 radio)
Environment
- OS: 任意
- Browser: 任意
- Framework: 任意
Any additional comments?
严格来讲,这其实不算bug,说是优化点可能更合适一点 :D
试一下最新版本 1.17.2 吧,好像没有能复现这个问题
是的,现在看起来一切良好 :)
我觉得这个问题已经解决了