Skip to content

[multi-select-combo-box] Focus out should not commit value #3645

@sissbruecker

Description

@sissbruecker

Description

This is kind of opinionated, but let's see what others think. When you enter a custom value, or a full predefined value, and then just blur the component, the custom value is committed (dispatches event), or the predefined item is added to the selection. While that is alright for the regular combo box, which just holds a single value, I think this is unexpected for a component that allows you to make a selection. I think something that can happen quite often is that the user enters something to try to filter for a predefined item, and when they don't find what they want they might just move on and interact with something else. However in that case the value is committed automatically.
IMO the selection should only be changed when interacting with the dropdown, or when pressing enter.

Expected outcome

An entered value should not be selected on focus out.

Actual outcome

Any entered value becomes selected on focus out.

Live demo (optional)

Bildschirmaufnahme.2022-04-06.um.15.28.55.mp4

Minimal reproducible example

See the component's dev page: https://github.com/vaadin/web-components/blob/e156bfbf0845d9e6dbfa86449e317c86f87459b0/dev/multi-select-combo-box.html

Note that the setup automatically adds custom values to the list of items, and to the selection, which is required to reproduce the steps below.

Steps to reproduce

  1. Enter foo
  2. Focus out
  3. Selection now contains foo

Environment

  • v23.1

Browsers affected

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions