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
The select2 html is not updated, although the last line {{selected}} is updated properly. Also, if I don't use the decorator, it works fine with regular select boxes.
After some more digging I created the following solution which can be placed in the decorator:
That's a really dirty workaround. You're destroying and recreating the entire select2 element every time any of the options changes. That causes FoUS and performance issues.
It would be much better to update the select2 options directly, but that seems to be a work in progress: select2/select2#2830
Sorry, but I can't put it in the decorator like this. When select2 allows modifying options through the API then I will be happy to add support for that though.
The component is called as follows:
the [field] part of fieldValues[field] is dynamically updated by another component, resulting the options parameter to change.
Component content:
The select2 html is not updated, although the last line {{selected}} is updated properly. Also, if I don't use the decorator, it works fine with regular select boxes.
After some more digging I created the following solution which can be placed in the decorator:
It will destroy and rebuild the decorator if the options are changed.
The text was updated successfully, but these errors were encountered: