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

Setting grid model selection can throw if grid rendering not yet complete #484

Closed
amcclain opened this issue Jul 30, 2018 · 1 comment
Closed
Assignees

Comments

@amcclain
Copy link
Member

We have a client app that's setting a selected record based on a "last viewed" preference / route and ensuring that gets set on the relevant Grid / GridModel via an autorun call to gridModel.selModel.select().

The app code has long had a delay: 1 opt on the auto-run "to account for grid rendering." Updated to latest hoist-react 11.0.0-SNAPSHOT and now that code is throwing within Grid.selectionReaction() as the node is not found. As a result, the row is not visible selected within the grid, and an error ends up on the console.

Trial and error showed that upping the delay to e.g. 300 works OK, but 100 or 200 does not - i.e. this is actually a time-based thing and not simply a matter of pushing to the end of the event loop.

Ideally we would not need any delays at all in client app code, and definitely want to avoid any fuzzy delays based on variable rendering performance. Curious though as to what changed - and then happy to help brainstorm ideas to make more reliable all around at the Hoist level.

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