Skip to content
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

fix: avoid clearing filter when pressing clear button on mobile #7091

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

sissbruecker
Copy link
Contributor

Disables the clear button logic from vaadin-combo-box-mixin, which clears the filter input when pressing the clear button. Instead, only the MSCB clear button logic is executed, which only clears the selection.

The bug actually only occurs on the first touch event, and not on subsequent ones. The root cause is that on the first clear, selectedItem is changed from undefined to null, which runs the respective change logic that also resets the input. Ideally selectedItem would be initialized with null, so the change would never happen. However, doing so results in a lot of test failures. I guess it would require additional changes to handle the initial Polymer change event then, but if someone has an idea feel free to make suggestions.

Fixes #7066

Disables the clear button logic from `vaadin-combo-box-mixin`, which clears the filter input when pressing the clear button. Instead, only the MSCB clear button logic is executed, which only clears the selection.

The bug actually only occurs on the first touch event, and not on subsequent ones. The root cause is that on the first clear, `selectedItem` is changed from `undefined` to `null`, which runs the respective change logic that also resets the input. Ideally `selectedItem` would be initialized with `null`, so the change would never happen. However, doing so results in a lot of test failures. I guess it would require additional changes to handle the initial Polymer change event then, but if someone has an idea feel free to make suggestions.
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@sissbruecker sissbruecker merged commit 89bace1 into main Jan 18, 2024
9 checks passed
@sissbruecker sissbruecker deleted the fix/mscb-mobile-clear branch January 18, 2024 12:50
vaadin-bot pushed a commit that referenced this pull request Jan 18, 2024
Disables the clear button logic from `vaadin-combo-box-mixin`, which clears the filter input when pressing the clear button. Instead, only the MSCB clear button logic is executed, which only clears the selection.
sissbruecker added a commit that referenced this pull request Jan 18, 2024
… (#7092)

Disables the clear button logic from `vaadin-combo-box-mixin`, which clears the filter input when pressing the clear button. Instead, only the MSCB clear button logic is executed, which only clears the selection.

Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
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] Clear button on mobile clears input but doesn't update dropdown items
3 participants