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:
angelinazzz1809
2026-05-06 15:27:28 -07:00
committed by GitHub
parent 872d2c01d4
commit 5b65a6bc78
+2 -2
View File
@@ -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;