You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@FredUK I'm also having issues with this when I try to change content of the dropdown component when some value has already been selected. Then the dropdown becomes disabled. Have you perhaps found a quick fix for this or can point me towards on how to make one in the add-on code? Thanks!
I solved it with this stupid hack in initSelection. It resets the input after content from computed property has been changed and selected value is no longer in the content. Works for me. ¯_(ツ)_/¯
var contentIds = content.map(function (item) { return item.id });
var valuePresentInIds = contentIds.indexOf(value) != -1;
if (!value || !value.length || !valuePresentInIds) {
return callback([]);
}
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:
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.
The text was updated successfully, but these errors were encountered: