diff --git a/common/src/jsMain/kotlin/dev/inmo/micro_utils/common/SelectFile.kt b/common/src/jsMain/kotlin/dev/inmo/micro_utils/common/SelectFile.kt index c1b3a7c716c..c2af68ad32d 100644 --- a/common/src/jsMain/kotlin/dev/inmo/micro_utils/common/SelectFile.kt +++ b/common/src/jsMain/kotlin/dev/inmo/micro_utils/common/SelectFile.kt @@ -14,7 +14,6 @@ fun selectFile( (document.createElement("input") { (this as HTMLInputElement).apply { type = "file" - inputSetup(this) onchange = { runCatching { files ?.get(0) ?: error("File must not be null") @@ -24,6 +23,7 @@ fun selectFile( onFailure(it) } } + inputSetup(this) } } as HTMLElement).click() }