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

Reactabular always creates new elements for rows and cells #346

Open
tstrachota opened this issue May 4, 2018 · 3 comments
Open

Reactabular always creates new elements for rows and cells #346

tstrachota opened this issue May 4, 2018 · 3 comments

Comments

@tstrachota
Copy link

Reactabular always creates new elements for rows and cells. That is causing problems like focus loss when controlled class components are used for inline editing.

I guess that the problem is that React.createElement is used in the render methods:
https://github.com/reactabular/reactabular/blob/master/packages/reactabular-table/src/body-row.js#L34
https://github.com/reactabular/reactabular/blob/master/packages/reactabular-table/src/body-row.js#L58

@bebraw
Copy link
Member

bebraw commented May 4, 2018

I am current doing a big rewrite at #345 .

Maybe you could have a look at my PR and comment there so I get it right this time. 👍

@tstrachota
Copy link
Author

Thank you, I'll try to find some time for testing it.
I checked the PR just briefly. Is the new interface going to be backward compatible? I'd like to avoid migrating all of our projects.

@bebraw
Copy link
Member

bebraw commented May 7, 2018

@tstrachota I don't think so. I guess the best we could do is to write an adapter you could apply. formatters and transforms will be replaced with a single field.

Some of the details are still in flux but the new design feels simpler than the earlier. Also sticky handling is easier as we hid the refs. Provider gives a small registration interface for this at the moment and then the components that have to synchronize go through that.

I still don't know what's the right way to fit fixed columns into the new design but we don't have to solve every single problem in this pass. I feel the simplification alone makes it all worthwhile.

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