https://github.com/ant-design/ant-design/issues/11215Go to Github

FundedView inonDoubleClick of Table onRow doesn't work#11215

leizhangcnnzcreated the issue 3 months ago

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.4.4

Environment

OS: Windows and Ubuntu, Browser IE 11,10,9, Firefox

https://ant.design/components/table/

Steps to reproduce

To make it simple, we assume there is a table has two column. The data of column A is a simple text, the data of column B is a list of text. Eg.

----------------------
|    A   |     B    |
----------------------
|   data  |    dd1  |
|         |    dd2  |
----------------------

The compiled html is kind like:

<tr>
  <td>data</td>
  <td>
    <div>dd1</div>
    <div>dd2</div>
</tr>

We need to add onDoubleClick action on the table row to pop up a promt, add the action to table onRow:

onRow={(record) => {
    return {
      onDoubleClick: () => {
         // popup a promt;
      },
    };

At this step, It works well, double click any place, like data cell or "dd1/dd2" cell, it wil popup the promt.

The we also need the onClick action for the table row, as the usage of onRow saying, we add onClick to the onRow:

onRow={(record) => {
    return {
      onDoubleClick: () => {
         // popup a promt;
      },
      onClick: () => {
        // do other things;
      }, 
    };

At this step, the double click on the "data" cell works well, but the double click on the "dd1/dd2" cell doesn't work anymore. Debug the js code I found all the double click on the "dd1/dd2" cell changes to two single click. onClick works fine.

if cell "dd1/dd2" has padding, then click the padding of "dd1/dd2" cell, on double click works, but click on "dd1/dd2" texts or the div of "dd1/dd2" doesn't work.

However, if we remove the onClick action in onRow, double click works for all cells, no matter it's click on padding or text.

What is expected?

onDoubleClick should works well with onClick for all types of table cells.

What is actually happening?

See the "Step to reproduce"

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->

Logs

  1. loadbalance-sudachi-kunfunded $256about 1 month ago
  2. 0maxxam0funded $23 months ago

Total Fund

$258

You will get $180.6 when resolving this issue

Funded by

2

Work status

No one is working