-
Notifications
You must be signed in to change notification settings - Fork 83
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
refactor: reduce item renderer calls in combo box #8173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#7044 introduced a number of requestContentUpdate
calls for several scenarios:
- Clear cache
- Change size
- Page loads
With that, the component now effectively runs ComboBoxMixin.requestContentUpdate
three times when filtering using a data provider. Previously the method wasn't run at all and only the scroller would update.
But ComboBoxMixin.requestContentUpdate
, in addition to updating the scroller, also runs renderers for all items again. So that results in three additional renderer calls for each item, for each filter change, when using a data provider.
Before the change
after.mov
After the change
before.mov
It looks like we can optimize that to only run requestContentUpdate
on the scroller instead. I guess the question is then if there is any logic in data provider mixin that could cause an item's data to be updated, instead of the whole item reference, in which case this optimization would probably break something.
Quality Gate passedIssues Measures |
This ticket/PR has been released with Vaadin 24.6.0.beta1 and is also targeting the upcoming stable 24.6.0 version. |
Replaces calls to
ComboBoxMixin.requestContentUpdate
with callingrequestContentUpdate
on the scroller, which avoids additional item renderer calls after the scroller has already updated.