Element UI version
2.13.2
OS/Browsers version
mac 10.15.7/chrome 86.0.4240.111(正式版本) (x86_64)
Vue version
3.0.2
Reproduction Link
https://codepen.io/small-fy/pen/WNxjvbR
Steps to reproduce
渲染表格后,鼠标拖动input框至其它单元格,然后再松开鼠标,会发现触发了row-click事件
What is Expected?
当鼠标松开时,不会触发row-click绑定的事件
What is actually happening?
当鼠标松开时,触发了row-click绑定的事件
3条答案
按热度按时间f5emj3cl1#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
nafvub8i2#
我遇到同样的问题,选中表格中的文本时候,会触发
row-click
事件。I encountered the same problem. When selecting text in the table, the
row-click
event will be triggered.element-ui@2.15.2
eit6fx6z3#
我遇到同样的问题,选中表格中的文本时候,会触发
row-click
事件。I encountered the same problem. When selecting text in the table, the
row-click
event will be triggered.element-ui@2.15.2
验证后,发现不是el-table的原因, 用原生的html+js也能复现,即“框选元素文本会触发元素的click事件”。
我们目前的方式是,在row-click事件中通过
getSelection()
判断一下是否有内容选中,以区分是框选还是点击。如果有更好的方式, 欢迎讨论。