bs-webapi-incubator
bs-webapi-incubator copied to clipboard
unsafeAsHtmlInputElement
I have an issue to get a html input element. I can't find any method to convert Dom.element
to Dom.htmlInputElement
or Dom.htmlElement
to Dom.htmlInputElement
. I could make an identity binding to convert it as a workaround. Is there any other way to get an html input element from dom or convert it?
external unsafeAsHtmlInputElement: Dom.element => Dom.htmlInputElement = "%identity"
let inputFile = Dom.document |> Dom.Document.getElementById("input-file")
inputFile
->Belt.Option.map(inputFile' => {
inputFile'->unsafeAsHtmlInputElement->Dom.HtmlInputElement.setValue("")
})