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

Grid steals focus during browser blur event because document.activeElement is set to body in Chrome #714

Closed
supamanda opened this issue Mar 28, 2017 · 0 comments

Comments

@supamanda
Copy link
Contributor

supamanda commented Mar 28, 2017

HAVE YOU ALREADY SEARCHED FOR SIMILAR ISSUES? PLEASE HELP US OUT AND DOUBLE-CHECK FIRST!

ALSO, PLEASE DON'T BE THAT PERSON WHO DELETES THIS TEMPLATE. IT'S HERE FOR A REASON.

THANKS!

WHICH VERSION OF REACT ARE YOU USING?

Officially Supported:
[ ] v0.14.x
Community Supported:
[x ] v15.0.x

WHICH BROWSER ARE YOU USING?

Officially Supported:
[ ] IE 9 / IE 10 / IE 11
[ ] Edge
[x ] Chrome
Should work:
[ ] Firefox
[ ] Safari

I'm submitting a ... (check one with "x")

[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md

Current behavior
According to https://developer.mozilla.org/en-US/docs/Web/Events/blur,
Note: The value of Document.activeElement varies across browsers while this event is being handled (bug 452307): IE10 sets it to the element that the focus will move to, while Firefox and Chrome often set it to the body of the document.

Cell checkFocus() will steal focus if it has been selected and the focus is on the body - which may have happened during an onblur event.

Expected/desired behavior
The comment says:
Only focus to the current cell if the currently active node in the document is within the data grid.

The body is not within the data grid, so maybe it would be better not to autofocus when it is focused on the body.

Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem.

I've set up a sample that demonstrates the problem: see https://fiddle.jshell.net/supamanda/hLexpyx8/

What is the expected behavior?

What is the motivation / use case for changing the behavior?

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

No branches or pull requests

2 participants