Re: [csswg-drafts] How to implement and shape API for `<selectedoption>` element for `<select>` (#10242)

> How often is cloning done when an option (that's also the selected option) is being mutated? I.e., what is the timing story. 

Right now my prototype does it synchronously but I'd like to try building on MutationObserver which from my understanding is like microtask timing right?

> And if you mutate the selected option, is that reflected?

If the selected `<option>` has any descendant mutated, then yeah we want that to trigger a clone into `<selectedoption>`. If the author mutates the contents of `<selectedoption>` then I'm not planning on doing anything.

> I'm also wondering about the timing of the first time an option gets cloned when the end user hasn't made a choice yet.

We can update the contents of `<selectedoption>` when it is inserted into the document. Does that answer your question?


-- 
GitHub Notification of comment by josepharhar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10242#issuecomment-2167945526 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 14 June 2024 12:39:14 UTC