fix(frontend): Fix FileInput state when hidden (#3730)

This commit is contained in:
Faton Ramadani
2024-05-14 17:12:09 +02:00
committed by GitHub
parent b1a13bea20
commit da5eabdfbf
2 changed files with 4 additions and 1 deletions

View File

@@ -46,6 +46,8 @@
fileInput?.clearFiles()
}
}
let files: File[] | undefined = undefined
</script>
{#each Object.keys(css ?? {}) as key (key)}
@@ -90,6 +92,7 @@
class={twMerge('w-full h-full', css?.container?.class, 'wm-file-input')}
style={css?.container?.style}
submittedText={submittedFileText}
bind:files
>
{text}
</FileInput>

View File

@@ -21,7 +21,7 @@
const dispatch = createEventDispatcher()
let input: HTMLInputElement
let files: File[] | undefined = undefined
export let files: File[] | undefined = undefined
async function onChange(fileList: FileList | null) {
if (!fileList || !fileList.length) {