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

[multi-select-combo-box] Clear button does not work on iOS #4129

Closed
web-padawan opened this issue Jul 5, 2022 · 1 comment · Fixed by #4141
Closed

[multi-select-combo-box] Clear button does not work on iOS #4129

web-padawan opened this issue Jul 5, 2022 · 1 comment · Fixed by #4141

Comments

@web-padawan
Copy link
Member

Description

When clear-button-visible is set, tapping the button does not work.

msc-clear.mp4

Expected outcome

Expected clear button to clear on touchend, like it works in the regular vaadin-combo-box:

_onTouchend(event) {
if (!this.clearElement || event.composedPath()[0] !== this.clearElement) {
return;
}
event.preventDefault();
this._clear();

Minimal reproducible example

Check the example in the dev page.

Steps to reproduce

  1. Select some items
  2. Tap the "clear" button

Environment

Vaadin version(s): 23.2 alpha, 23.1

Browsers

Issue is not browser related

@web-padawan
Copy link
Member Author

web-padawan commented Jul 5, 2022

I had to do some research in order to justify the need for this touchend prevention. Here are my observations:

  1. The touchend listener was originally added by Set clear button not opening the overlay vaadin-combo-box#620
  2. Then it was changed in Fix toggling/clearing bug of <vaadin-combo-box-light> on mobile vaadin-combo-box#648
  3. Similar PR for date-picker: Set clear button not opening the overlay vaadin-date-picker#515

The actual reason for such behavior, as far as I remember, was to make it possible to clear the vaadin-combo-box on mobile device without focusing the input element (which we now do on clear button mousedown, see #2619).

Here is how clear button works for existing components (tested on desktop and with iOS Simulator):

component Desktop iOS Simulator
vaadin-combo-box Focus Don't focus
vaadin-time-picker Focus Don't focus
vaadin-date-picker Don't focus Don't focus
vaadin-text-field Focus Focus

I will create a separate issue to discuss whether we should align this behavior.
Until then, the solution would be to add touchend listener to vaadin-multi-select-combo-box.

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

Successfully merging a pull request may close this issue.

1 participant