mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2026-10-25 06:11:08 +00:00
fill changelog and rename selectOptionalFile to selectFileOrNull
This commit is contained in:
1 parent
9e84dc5031
commit
6dbd12df59
3 files changed
+25
-5
No files matched your search
@@ -7,13 +7,13 @@ import org.w3c.dom.HTMLInputElement
|
||||
import org.w3c.files.get
|
||||
|
||||
fun selectFile(
|
||||
inputSetup: HTMLInputElement.() -> Unit = {},
|
||||
inputSetup: (HTMLInputElement) -> Unit = {},
|
||||
onFailure: (Throwable) -> Unit = {},
|
||||
onFile: (MPPFile) -> Unit
|
||||
) {
|
||||
(document.createElement("input") {
|
||||
(this as HTMLInputElement).apply {
|
||||
inputSetup()
|
||||
inputSetup(this)
|
||||
onchange = {
|
||||
runCatching {
|
||||
files ?.get(0) ?: error("File must not be null")
|
||||
|
||||
Reference in new issue
Block a user