Skip to content

fix: support items with duplicate labels in combo-box - #6704

Merged
tomivirkki merged 1 commit into
mainfrom
fix/combo-box/duplicate-labels
Oct 27, 2023
Merged

tomivirkki merged 1 commit into
mainfrom
fix/combo-box/duplicate-labels

Conversation

@tomivirkki

Copy link
Copy Markdown
Member

Description

Fixes #6587

Type of change

Bugfix

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

} else {
// Try to find an item which label matches the input value.
const items = [...(this._dropdownItems || []), this.selectedItem];
const items = [this.selectedItem, ...(this._dropdownItems || [])];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When looking for an item that matches the input by label, check the currently selected item first

@knoobie knoobie Oct 27, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tomi, this fix was simpler than expected! :)

@tomivirkki
tomivirkki merged commit 193de94 into main Oct 27, 2023
@tomivirkki
tomivirkki deleted the fix/combo-box/duplicate-labels branch October 27, 2023 07:18
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @tomivirkki and @tomivirkki, when i performed cherry-pick to this commit to 24.2, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 193de94
error: could not apply 193de94... fix: support items with duplicate labels in combo-box (#6704)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @tomivirkki and @tomivirkki, when i performed cherry-pick to this commit to 24.1, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 193de94
error: could not apply 193de94... fix: support items with duplicate labels in combo-box (#6704)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.3.0.alpha3 and is also targeting the upcoming stable 24.3.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComboBox does not support duplicate item labels

4 participants