我试图使用Fable.React选择输入字段的文本。在js中,它可以像this一样完成,但是在Fable中尝试同样的操作并不能编译:
input [
Type "text"
OnFocus(fun e -> e.target.select())
]当输入字段使用Fable.React聚焦时,如何选择输入字段中的文本?
发布于 2018-11-25 14:17:19
解决方案是先转换event.target:
OnFocus(fun e ->
let target = e.target :?> Browser.HTMLInputElement
target.select()
)https://stackoverflow.com/questions/53466927
复制相似问题