Skip to content

Select-2 does not set _hasSelectedMissingItems back to false when setting "value" to null #120

@FredUK

Description

@FredUK

When select-2 detects that the selected "value" property no longer exists in "content" it sets itself to _hasSelectedMissingItems = true, disabling the element and throws the warning:

WARNING: select2#initSelection was not able to map each "identity" to an object from "content". The      remaining keys are: 4278905e-5ee2-0b96-9810-64aa7a3e16a7. The input will be disabled until a) the     desired objects is added to the "content" array or b) the "value" is changed."

It seems the input will only be re-enabled if the "value" is set to one of the remaining keys.
However one should be able to set the "value" back to null so that the input would still be re-enabled but without selecting any option.

When the input is disabled because the "value" is invalid, it should re-enable it when we reset "value" back to null, but this is not happening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions