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

[combo-box] Not possible to select an element from the list [2 days] #3363

Open
2 of 10 tasks
yuriy-fix opened this issue Jan 31, 2022 · 10 comments · Fixed by #4279
Open
2 of 10 tasks

[combo-box] Not possible to select an element from the list [2 days] #3363

yuriy-fix opened this issue Jan 31, 2022 · 10 comments · Fixed by #4279

Comments

@yuriy-fix
Copy link
Contributor

What is the problem?

On iOS with VoiceOver running and Android with TalkBack running, it is not possible to select an element from the list as, it seems, the options list does not immediately follow the <input> field. Swiping through content after the options list opens instead moves focus to the next available content.

Browsers

  • Chrome
  • Firefox
  • Safari
  • Safari on iOS
  • Edge

Screen Readers

  • None
  • NVDA
  • JAWS
  • VoiceOver on MacOS
  • VoiceOver on iOS
@yuriy-fix yuriy-fix added needs research More information needed to estimate a11y Accessibility issue vaadin-combo-box labels Jan 31, 2022
@vursen
Copy link
Contributor

vursen commented Mar 7, 2022

Here is a fragment of the code where the issue originates from:

_onFocusout(event) {
// Fixes the problem with `focusout` happening when clicking on the scroll bar on Edge
if (event.relatedTarget === this.$.dropdown.$.overlay) {
event.composedPath()[0].focus();
return;
}
if (!this.readonly && !this._closeOnBlurIsPrevented) {
// User's logic in `custom-value-set` event listener might cause input to blur,
// which will result in attempting to commit the same custom value once again.
if (!this.opened && this.allowCustomValue && this._inputElementValue === this._lastCustomValue) {
delete this._lastCustomValue;
return;
}
this._closeOrCommit();
}
}

For some reason, when using the combo-box in any of the mentioned browser + voice assistant combinations, the browser fires focusout for the combo-box with the first attempt to interact with its dropdown. That in turn triggers _onFocusout which closes the dropdown immediately.

As a workaround, we could add a check on relatedTarget in _onFocusout, forcing the method to return if the related target is a combo-box item or generally any child of the combo-box overlay.

@yuriy-fix
Copy link
Contributor Author

Let's timebox trying to find the solution for this one.

@yuriy-fix yuriy-fix changed the title [combo-box] Not possible to select an element from the list [combo-box] Not possible to select an element from the list [2 days] Jun 8, 2022
@web-padawan web-padawan self-assigned this Aug 1, 2022
@web-padawan
Copy link
Member

Confirmed that focusout is fired because VoiceOver actually moves focus to the combo-box item.
I think we can check for event.relatedTarget and if it's vaadin-combo-box-item, then ignore it.

@web-padawan web-padawan removed the needs research More information needed to estimate label Aug 1, 2022
@rolfsmeds rolfsmeds reopened this Aug 2, 2023
@rolfsmeds
Copy link
Contributor

According to latest a11y review by TetraLogical, This problem seems to persist in V24.2.alpha4.

@tomivirkki
Copy link
Member

According to latest a11y review by TetraLogical, This problem seems to persist in V24.2.alpha4.

Tested the ComboBox example on Vaadin docs (latest 24.2) and didn't have any issues selecting items on TalkBack. Not sure about iOS & VoiceOver

@rolfsmeds
Copy link
Contributor

Yeah iOS/VO is specifically the combo mentioned.

@vursen
Copy link
Contributor

vursen commented Nov 14, 2023

Tested the ComboBox example on Vaadin docs with iOS + VoiceOver.

I didn't have any issues with selecting items, but I did have issues with navigation (scrolling) inside the dropdown:

RPReplay_Final1699962786.MP4

I tried various gestures but none of them worked well, except for 3-finger swipe up and down, which more or less consistently navigated me between pages. I wonder if this is what Tetralogical actually had in mind when saying "it's still not possible to select items".

@vursen
Copy link
Contributor

vursen commented Dec 21, 2023

My latest investigation indicates that the issue is related to the virtualizer, and most probably the way it arranges elements in the DOM. The issue can be observed with the pure virtual list component.

Example:

<script type="module">
  import '@vaadin/virtual-list';

  const items = Array.from({ length: 100 }).map((_, i) => {
    return { label: `Item ${i}` };
  });

  const renderer = (root, _, { item }) => {
    root.innerHTML = `<button>${item.label}</button>`;
  };

  const list = document.querySelector('vaadin-virtual-list');
  list.items = items;
  list.renderer = renderer;
</script>

<vaadin-virtual-list style="height: 200px"></vaadin-virtual-list>

Recording:

In this recording, I'm trying to navigate the list with one-finger swipe left (next) or right (prev). You can see that the list loses focus at some point even though I haven't reached the end of the list.

At the end, I also try to scroll with one-finger tap + swipe down or up. You can see that it also doesn't work reliably and every so often I end up in an unexpected position.

RPReplay_Final1703158785.MP4

@rolfsmeds
Copy link
Contributor

Makes sense. I wonder if we have the same issue with Grid?

@vursen
Copy link
Contributor

vursen commented Dec 21, 2023

Makes sense. I wonder if we have the same issue with Grid?

Yes, I've just confirmed that the issue is reproducible with Grid as well:

RPReplay_Final1703170141.MP4

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.

5 participants