Skip to content

fix: keep input value when data provider resolves callback - #3971

Merged
web-padawan merged 1 commit into
masterfrom
fix/keep_input_value_on_data_provider_commit
May 30, 2022
Merged

web-padawan merged 1 commit into
masterfrom
fix/keep_input_value_on_data_provider_commit

Conversation

@sissbruecker

Copy link
Copy Markdown
Member

Description

Prevent data provider mixin from clearing the input value when the data provider callback resolves. The data provider mixin relies on the focused attribute being present on the combo box to determine whether the component is actively used, however the focused attribute is never set on the internal combo box. This change propagates the focused attribute to the internal combo box to fix that.

Fixes #3969

Type of change

  • Bugfix

@sissbruecker
sissbruecker requested a review from web-padawan May 30, 2022 14:54
@sissbruecker

Copy link
Copy Markdown
Member Author

Maybe we should also add a regression test, however the component currently doesn't have any lazy loading tests.

@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

@web-padawan web-padawan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Ideally, we should replace checks for focused attribute with something like this:

export function isElementFocused(element) {
return element.getRootNode().activeElement === element;
}

I will create a separate issue to not block this PR.

@web-padawan
web-padawan merged commit 51a1a42 into master May 30, 2022
@web-padawan
web-padawan deleted the fix/keep_input_value_on_data_provider_commit branch May 30, 2022 15:58
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 23.1.0.rc2 and is also targeting the upcoming stable 23.1.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.

[multi-select-combo-box] Input value cleared automatically when combining data provider and auto open disabled

3 participants