3 ms·
> Option: Nothing by default, but provide a way to trigger an update I would strongly suggest this option unless there's a strong reason the browser must keep
by _heimdall 2y ago
> Option: Nothing by default, but provide a way to trigger an update
I would strongly suggest this option unless there's a strong reason the browser must keep the elements in sync automatically.
Unless I'm mistaken, the other options could all be done in userland with a MutationObserver, a debounce method wrapping a timeout, and custom logic optimizing updates for specific attributes or changes.
I'm particularly worried about how automatic updates/cloning will work across different frontend frameworks. Today's more popular frameworks already diverge quite a bit with how they handle rerendering and DOM updates, and the next big framework to come along could take a more radical approach to rendering and interactivity.
In my opinion, anything that can reasonably be done in user code should be done there - at least until it causes enough problems that it needs to be solidified into browser specs. I'm always worried that the any clever built-in magic may work today but cause problems later, and because removing the spec is difficult most users would just skip the new <selectedoption> element all together.