I’m struggling to find a safe way to update select2 selection from another webcomponent. When I try to update the selection from the outside I reach an inconsistent state.
This is the code
This is fine:
https://www.awesomescreenshot.com/video/5065573?key=e8a7b3db9088e6f77e0ba82b7cb3f427
This other video shows the problem. this.value
in my-element.js
and in select-token-filter2.js
is not consistent with the state of select2 options:
[www].awesomescreenshot.com/video/5065592?key=ed265e31c692a43c07ef5f45105feb28
I tried manually creating <options>
and a lot of other methods. Is there a safe way to accomplish a “2-way binding” between the underlying state of this.value
and select2 UI?