NAV*_*GAM 5 firefox file-upload input click blazor
我正在创建一个 blazor 应用程序,在其中我使用隐藏文件输入和 click() 方法打开文件选择器。它在 Chrome、Edge 中运行良好。文件选择器未在 Firefox 中打开。
下面是我重现该问题的示例代码。index.razor:
@inject IJSRuntime JSRuntime;
@*File Input is clicked using JSinterop on blazor click event of button*@
<div>
<button @onclick="OnClick">Select File</button>
<input type="file" id="fileElem" multiple style="display:none">
</div>
@code{
private async Task OnClick()
{
//Triggers the click event of file Input
await JSRuntime.InvokeVoidAsync("elementClick", "fileElem");
}
}
Run Code Online (Sandbox Code Playgroud)
JSInterop:
window.elementClick = (Id) => {
// Triggers click event of the element
document.getElementById(Id).click();
};
Run Code Online (Sandbox Code Playgroud)
有没有办法解决上述问题?
火狐版本:72.0.2
更新:我也在BUGZILLA 中报告了这个问题
报告的问题已在 Firefox 中得到解决。查看以下与该问题相关的错误报告以供参考。
https://bugzilla.mozilla.org/show_bug.cgi?id=1610726
https://bugzilla.mozilla.org/show_bug.cgi?id=1678389
| 归档时间: |
|
| 查看次数: |
1157 次 |
| 最近记录: |