fix: run the class name generator only for loaded rows #3789
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The PR prevents the grid css class name generator from running on the rows that the data provider is still loading. That way the Flow Grid class name generator does no longer receive the cells that don't have
_item
assigned yet and thus the original error reported in the issue no longer takes place:Scenario: When a column group changes its hidden state, it triggers the cells' class names to re-generate. When that coincides with the data provider loading more rows, there may occur a race condition because of using debouncers so that the generator will be invoked on the rows that the virtualizer has already created but which don't have
_item
assigned yet.Note, it is fine to just filter out such loading rows before running the generator since the data provider will run the generator as soon as all the rows are loaded anyway.
Fixes vaadin/flow-components#3082
Type of change
Checklist