ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.12k stars 14.64k forks source link

[Bug Report] row-click #20341

Open small-Fy opened 4 years ago

small-Fy commented 4 years ago

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绑定的事件

stale[bot] commented 2 years ago

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.

iamyans commented 9 months ago

我遇到同样的问题,选中表格中的文本时候,会触发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

iamyans commented 9 months ago

我遇到同样的问题,选中表格中的文本时候,会触发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()判断一下是否有内容选中,以区分是框选还是点击。

如果有更好的方式, 欢迎讨论。