mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-24 14:16:06 +00:00
Update UIPrompt.js (#2930)
In the app environment, the prompt input was initialized using `options.value`, so `defaultValue` was not reflected. This change ensures that `defaultValue` is used when provided, while keeping backward compatibility with `options.value`.
This commit is contained in:
@@ -47,7 +47,7 @@ function UIPrompt (options) {
|
||||
h += `<div class="window-prompt-message">${options.message}</div>`;
|
||||
// prompt
|
||||
h += '<div class="window-alert-prompt" style="margin-top: 20px;">';
|
||||
h += `<input type="text" class="prompt-input" placeholder="${options.placeholder ?? ''}" value="${options.value ?? ''}">`;
|
||||
h += `<input type="text" class="prompt-input" placeholder="${options.placeholder ?? ''}" value="${options.defaultValue ?? options.value ?? ''}">`;
|
||||
h += '</div>';
|
||||
// buttons
|
||||
if ( options.buttons && options.buttons.length > 0 ) {
|
||||
@@ -129,4 +129,4 @@ function UIPrompt (options) {
|
||||
});
|
||||
}
|
||||
|
||||
export default UIPrompt;
|
||||
export default UIPrompt;
|
||||
|
||||
Reference in New Issue
Block a user