As part of story #31537 and story #28823, we want to reuse Lazybox as a cleaner and simpler alternative to Select2. We also need to add some functionality to it ("create a new item" button).
The current state of the Lazybox code gives us a hard time to add functionality, as everything depends on Elements that are bounced around, mutated, some events are attached to them, etc. All of this is done on several different classes. The current clean-up effort aims to:
- use a reactive templating library instead of the vanilla dom API. Stop managing Elements and instead declare the HTML template and attach handlers to it
- expose Lazybox as a custom element instead of a function. Users will no longer need to worry about handling
destroy()
, will no longer need to create an empty <select>
element to wrap it, and can still attach callbacks and customize its behaviour.