Skip to content

Commit 76f4383

Browse files
authored
Fix file upload button (#824)
Fixes #612 ### Description Fixes the file upload button. The problem is caused by `<button>` element that wraps file upload input having no `type` attribute. When used inside a form it defaults to `type="submit"` ([REF](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button)) which causes the page to reload (or submitting the form to the same url) at the same time as opening the upload dialog. The upload dialog itself does nothing in this case because it is mounted to the old page (before reload). <img width="975" alt="Bildschirmfoto 2024-07-28 um 19 48 31" src="https://github.com/user-attachments/assets/d0b27bd4-bd7b-4793-ac07-c4b6c0011c9f">
1 parent b15f74e commit 76f4383

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/widgets/src/lib/components/InferenceWidget/shared/WidgetFileInput/WidgetFileInput.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<LogInPopover bind:open={popOverOpen}>
3434
<button
3535
class={classNames}
36+
type="button"
3637
on:click={(e) => {
3738
if (!$isLoggedIn) {
3839
popOverOpen = true;

0 commit comments

Comments
 (0)