Skip to content

Multiple select does not get properly initialized when having certain options pre-selected #3842

Open
@MICSCHWA

Description

@MICSCHWA

I've been testing the multiple select of ECL within an update form and realized that when having options selected on initialization, the counter (the small tag displayed at the beginning of the control) won't show up... I also have the issue that the counter doesn't seem to work correctly in certain scenarios (e.g. I wanted to use it for a kind of keyword selection with 100+ options).

You can re-produce this inside the playground as well (tested in v4.10.0). Just go to the sample code for "Components > Form > Select multiple" and update the options of the select to something like:

  ...
  <optgroup label="European countries">
    <option value="1">Belgium</option>
    <option value="2">France</option>
    <option value="3" disabled="">Luxembourg</option>
    <option value="4" selected="">Germany</option>
    <option value="5" selected="">Bulgaria</option>
    <option value="6">Italy</option>
    <option value="7">Romania</option>
    <option value="8">Greece</option>
    <option value="9">Hungary</option>
    <option value="10">Portugal</option>
  </optgroup>
  <optgroup label="Non European countries">
    <option value="11" selected="">China</option>
  </optgroup>
  <option value="12">standalone option</option>
 ...

Small addition:
When using this syntax:

  <option value="4" selected="selected">Germany</option>

... you can de-select this option but you cannot select it anymore.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions