diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 66278964f47..6447dc24786 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -3,6 +3,7 @@ - **ApiTreeSelect** 修复未能正确监听`params`变化的问题 - **BasicTable** 修复可编辑单元格不支持`ellipsis`配置的问题 - **ImgRotateDragVerify** 修复组件`resume`方法无法调用的问题 +- **TableAction** 修复 stopButtonPropagation 属性某些情况下不起作用的问题 - **Dark Theme** 黑暗主题下的配色问题修正 - 修复`Tree`组件被选中节点的背景颜色 - 修复`Alert`组件的颜色配置 diff --git a/src/components/Table/src/components/TableAction.vue b/src/components/Table/src/components/TableAction.vue index 1deed7e7dd5..50aeb3cd59d 100644 --- a/src/components/Table/src/components/TableAction.vue +++ b/src/components/Table/src/components/TableAction.vue @@ -140,10 +140,11 @@ function onCellClick(e: MouseEvent) { if (!props.stopButtonPropagation) return; - const target = e.target as HTMLElement; - if (target.tagName === 'BUTTON') { - e.stopPropagation(); - } + const path = e.composedPath() as HTMLElement[]; + const isInButton = path.find((ele) => { + return ele.tagName?.toUpperCase() === 'BUTTON'; + }); + isInButton && e.stopPropagation(); } return { prefixCls, getActions, getDropdownList, getAlign, onCellClick, getTooltip };