Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
dcorb opened this issue Feb 2, 2018 · 7 comments
Closed
1 task

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

dcorb opened this issue Feb 2, 2018 · 7 comments
Labels

Comments

@dcorb
Copy link

dcorb commented Feb 2, 2018

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 dcorb changed the title No selected event on the first cell (0,0) No onCellSelected event fired on the first cell (0,0) Feb 2, 2018
@bonimba
Copy link
Contributor

bonimba commented Feb 12, 2018

Hi @dcorb,

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

@bonimba bonimba closed this as completed Feb 12, 2018
@dcorb
Copy link
Author

dcorb commented Feb 12, 2018

Thanks! 💯

@dcorb
Copy link
Author

dcorb commented Feb 13, 2018

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

@bonimba
Copy link
Contributor

bonimba commented Feb 13, 2018

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.

@stale
Copy link

stale bot commented Jul 12, 2018

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 stale bot added the wontfix label Jul 12, 2018
@stale stale bot closed this as completed Jul 19, 2018
@iamkennytso
Copy link

iamkennytso commented Oct 11, 2018

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

@iamkennytso
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants