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

[Combobox] Using mouse to remove a selected item can fail when the combobox is vertically centered #293

Open
Jokinen opened this issue Oct 28, 2020 · 0 comments
Labels
bug Something isn't working.

Comments

@Jokinen
Copy link
Contributor

Jokinen commented Oct 28, 2020

Describe the bug

This is very specific behaviour, but I'm reporting it in order to document this scenario.

When the user has focused the input of the combobox and then uses their mouse to remove a selection, the focus changes from the input into the selected tag. Because the input is only visible when it is focused, the input is hidden. This changes the height of the combobox itself.

This means that the height of the wrapping element may also change. If this container, or the combobox itself, are centered or bottom aligned, the input will move on the screen. The shift may be large enough to cause the selected items to move from under the cursor. In this case the click event won't fire, because the user is mouseupping on another element than the selected item they attempted to delete.

How to reproduce

  1. Use combobox in a flex container that center's its children vertically
  2. Select an item
  3. Focus input
  4. Use mouse to remove item
    • To get a better sense of how the UI shifts, mousedown for a while and only then mouseup
  5. Expect removal to fail

Expected behavior

It should be possible to remove selected items by clicking even within a vertically centered container.

Possible solution

I don't know what's the most appropriate technical solution, but its goal should likely be to keep the input visible while elements are being removed by clicking.

@ronijaakkola ronijaakkola added the bug Something isn't working. label Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants