react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

No onCellSelected event fired on the first cell (0,0)

Open dcorb opened this issue 8 years ago • 7 comments

Which version of React JS are you using?

⚠️ Not officially supported, expect warnings ⚠️

  • [ ] v15.5.x
  • [X ] v15.6.x

Which browser are you using?

✅ Officially supported ✅

  • [ X] Chrome

I'm submitting a ...

  • [X ] 🐛 Bug Report

Issue Details

- What the current behavior is In this demo case: https://jsfiddle.net/3su9me5j/2/ Clicking on the first cell, position 0,0, it won't call the onCellSelected handler, not entering in the debugger mode. (With devtools open) - What the desired behvaior is Clicking on the first cell, position 0,0, will behave like any other cell, executing onCellSelected function, and entering in the debugger mode (With devtools open)

The problem is that the initial "selected" value is 0,0 https://github.com/adazzle/react-data-grid/blob/master/packages/react-data-grid/src/ReactDataGrid.js#L154

If I assign the value enableCellSelectas false, it works. But it should be true, as I understand.

dcorb avatar Feb 02 '18 14:02 dcorb

Hi @dcorb,

thanks for reporting the issue. Good news: It's been fixed in version 3.0.11 :)

bonimba avatar Feb 12 '18 09:02 bonimba

Thanks! 💯

dcorb avatar Feb 12 '18 09:02 dcorb

I think it doesn't work still, I updated the demo with 3.0.11 https://jsfiddle.net/3su9me5j/5/

dcorb avatar Feb 13 '18 16:02 dcorb

That's weird: It works fine for me. I'll try to look into it asap to see what can cause this different behaviour.

Edit: I now see what you mean. the last cell that has been selected keeps the focus even when clicking out of the grid, so focusing on that cell again doesn't trigger the method. I'll reopen the issue and try to work on this asap.

bonimba avatar Feb 13 '18 17:02 bonimba

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Jul 12 '18 12:07 stale[bot]

Has this been fixed or is there a workaround? We're experiencing this issue currently. Using version 4.0.7

iamkennytso avatar Oct 11 '18 18:10 iamkennytso

I've tried adding a temporary dom element .focus() and then removing the temporary element, but the problem still persists. Not sure if it's a focus issue or not.

iamkennytso avatar Oct 11 '18 19:10 iamkennytso