fix: support defaultValue in showColorPicker app env (#2895) (#2932)

Co-authored-by: devareddy05 <pdevendrareddy@guidewire.com>
This commit is contained in:
Devendra Reddy Pennabadi
2026-05-06 10:46:32 -07:00
committed by GitHub
co-authored by devareddy05
parent eb9e316ed5
commit b3bf979cac
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ async function UIWindowColorPicker (options) {
},
onAppend: function (window) {
colorPickerWidget = UIColorPickerWidget($(window).find('.picker'), {
default: options.default ?? '#f00',
default: options.defaultValue ?? options.default ?? '#f00',
});
},
window_class: 'window-login',
+1 -1
View File
@@ -881,7 +881,7 @@ class UI extends EventListener {
return new Promise((resolve) => {
const opts = typeof options === 'string' ? { defaultColor: options } : (options ?? {});
const el = document.createElement('puter-color-picker');
const defaultColor = opts.defaultColor || opts.default || '#3b82f6';
const defaultColor = opts.defaultValue || opts.defaultColor || opts.default || '#3b82f6';
el.setAttribute('default-color', defaultColor);
el.addEventListener('response', (e) => resolve(e.detail));
document.body.appendChild(el);