Bug 258862 - <option> label attribute updates are not shown until focus is moved
Summary: <option> label attribute updates are not shown until focus is moved
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-04 18:51 PDT by bugzilla.krzysdz
Modified: 2023-07-11 03:05 PDT (History)
4 users (show)

See Also:


Attachments
Problem demonstration (2.21 KB, text/html)
2023-07-04 18:51 PDT, bugzilla.krzysdz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugzilla.krzysdz 2023-07-04 18:51:37 PDT
Created attachment 466927 [details]
Problem demonstration

Changes made from JS to label of a selected <option> in <select> are not rendered unless the focus changes. If the new value is assigned using textContent (and there is no label attribute), the text of the <option> will be updated. If label of a selected <option> is changed, re-selecting it may help, but changing textContent of another <option> works too.

If the label was changed in a <button> "click" event listener, it will be rendered only if the focus moves to the <select>. If the change happened as a result of <select> "change" event, the change will be reflected on the list of options, but the <select> will render it as its selected value when the focus moves to another element.

The behaviour is present in Safari 16.5.1, Safari TP 173 and Epiphany TP 45.alpha-5-g2486bfbdf+.

The problem is similar to bug 255230 (and the demo is based on it), but affects label updates, not innerText or textContent.
Comment 1 bugzilla.krzysdz 2023-07-06 16:18:40 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15615
Comment 2 EWS 2023-07-11 03:04:31 PDT
Committed 265942@main (06461c59e1c1): <https://commits.webkit.org/265942@main>

Reviewed commits have been landed. Closing PR #15615 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-07-11 03:05:18 PDT
<rdar://problem/112069033>