refactor: simplify multi-select-combo-box updating chips logic#11295
Merged
web-padawan merged 1 commit intomainfrom Mar 10, 2026
Merged
refactor: simplify multi-select-combo-box updating chips logic#11295web-padawan merged 1 commit intomainfrom
web-padawan merged 1 commit intomainfrom
Conversation
- Extract autoExpandVertically into early return path without overflow logic - Split horizontal-expand and default chip strategies into separate methods - Replace O(n²) backward iteration + unshift with forward iteration + map - Cache __getOverflowWidth() before loop instead of calling per iteration - Extract __getWrapperWidth() helper for repeated wrapper width access - Add early return for empty selectedItems to skip style computations - Move remainingWidth/chipMinWidth computation into each helper method - Remove unnecessary selectedItems array copy since items are no longer mutated Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4a0b6bc to
69823a1
Compare
|
sissbruecker
approved these changes
Mar 10, 2026
vaadin-bot
pushed a commit
that referenced
this pull request
Mar 10, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
vaadin-bot
pushed a commit
that referenced
this pull request
Mar 10, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
This ticket/PR has been released with Vaadin 25.1.0-beta3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
autoExpandVerticallyinto an early return path, avoiding all width measurement logic__updateChipsHorizontalExpandand__updateChipsDefaultmethodsunshiftwith forward iteration +mapin horizontal-expand path__getOverflowWidth()before the while loop instead of calling it per iteration__getWrapperWidth()helper for repeatedthis._inputField.$.wrapper.clientWidthaccessselectedItemsto skip style computationsremainingWidth/chipMinWidthcomputation into each helper so they only compute what they need[...this.selectedItems]array copy since items are no longer mutatedTest plan
yarn test --group multi-select-combo-box)🤖 Generated with Claude Code