Bug 166930 - Value of a color input does not update visually when using setAttribute
Summary: Value of a color input does not update visually when using setAttribute
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-01-11 10:22 PST by Darryl Pogue
Modified: 2021-05-20 06:21 PDT (History)
10 users (show)

See Also:


Attachments
Patch (3.97 KB, patch)
2021-05-19 16:09 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darryl Pogue 2017-01-11 10:22:39 PST
With an <input type="color">, if you set the value dynamically via setAttribute('value', '#ff0000') it still shows the input color visually as black rather than the updated value (red, in this case).
The actual value of the input is correct, and if you open the color picker then it shows the correct value selected.

Here's an example JSFiddle which starts out black and sets the value via setAttribute after 1.5 seconds: https://jsfiddle.net/1wLsa0jc/
Comment 1 Radar WebKit Bug Importer 2017-01-11 19:13:22 PST
<rdar://problem/29983218>
Comment 2 Aditya Keerthi 2021-05-19 16:09:35 PDT
Created attachment 429108 [details]
Patch
Comment 3 Aditya Keerthi 2021-05-20 06:18:19 PDT
Thanks for the review!
Comment 4 EWS 2021-05-20 06:21:49 PDT
Committed r277778 (237939@main): <https://commits.webkit.org/237939@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429108 [details].