Skip to content

refactor: remove no longer used code - #4220

Merged
web-padawan merged 1 commit into
masterfrom
refactor/remove-unused-code
Jul 15, 2022
Merged

web-padawan merged 1 commit into
masterfrom
refactor/remove-unused-code

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Previously, this code was covered by two tests that incorrectly used selectItem helper, see #4217.
In fact, the event is always fired on item click, which is only possible when combo-box is opened:

/** @private */
__onItemClick(e) {
this.dispatchEvent(new CustomEvent('selection-changed', { detail: { item: e.currentTarget.item } }));
}

And setting selectedItem actually happens when committing value after closing the dropdown:

const focusedItem = this.filteredItems[this._focusedIndex];
if (this.selectedItem !== focusedItem) {
this.selectedItem = focusedItem;
}

This behavior is intentional and has been first introduced in vaadin/vaadin-combo-box#785

Type of change

  • Refactor

@web-padawan
web-padawan requested a review from vursen July 15, 2022 13:23
@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
No Duplication information No Duplication information

@web-padawan
web-padawan merged commit c422154 into master Jul 15, 2022
@web-padawan
web-padawan deleted the refactor/remove-unused-code branch July 15, 2022 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants