diff --git a/web/src/dialog_widget.ts b/web/src/dialog_widget.ts index 9bcf89bb14..84ecf6401f 100644 --- a/web/src/dialog_widget.ts +++ b/web/src/dialog_widget.ts @@ -147,7 +147,14 @@ export function launch(conf: WidgetConfig): void { const current_values: Record = {}; $inputs.each(function () { const property_name = $(this).attr("name")!; - current_values[property_name] = $(this).val(); + if (property_name) { + if ($(this).is("input[type='file']") && $(this).prop("files")?.length) { + // If the input is a file input and a file has been selected, set value to file object + current_values[property_name] = $(this).prop("files")[0]; + } else { + current_values[property_name] = $(this).val(); + } + } }); return current_values; }