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

Focus on cell component when editing #51

Closed
Dineshz opened this issue Dec 18, 2017 · 2 comments
Closed

Focus on cell component when editing #51

Dineshz opened this issue Dec 18, 2017 · 2 comments

Comments

@Dineshz
Copy link

Dineshz commented Dec 18, 2017

Is it possible to focus or pass the enter key event to the custom component when in editing mode (forceComponent is set to true) ?

My use case:
I have a custom Select options component inside the cell, with forceComponent: true. I would like to capture the enter key event/focus and open the Select dropdown.

@nadbm
Copy link
Owner

nadbm commented Dec 18, 2017

I'll have to make sure of this, but enter key event is currently being propagated.

https://nadbm.github.io/react-datasheet/ <-- check the last example with the select component

@Dineshz
Copy link
Author

Dineshz commented Dec 19, 2017

Since the autoFocus attribute is used on react-select, which focuses the component on mount, the Select component is focused. But when using forceComponent:true.. I cannot use autoFocus attribute, in which case, the focus event/enter key event does not propagate from ComponentCell.

Solution:

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