Skip to content

Commit

Permalink
🎨 Add document.appendChild(input) on WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceglb committed Dec 11, 2024
1 parent 3e5e93d commit b74cb6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public actual object FileKit {
suspendCoroutine { continuation ->
// Create input element
val input = document.createElement("input") as HTMLInputElement

// Visually hide the element
input.style.display = "none"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ public actual object FileKit {
suspendCoroutine { continuation ->
// Create input element
val input = document.createElement("input") as HTMLInputElement

// Visually hide the element
input.style.display = "none"

document.body?.appendChild(input)

// Configure the input element
input.apply {
this.type = "file"
Expand Down

0 comments on commit b74cb6f

Please sign in to comment.