You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
your minified js is included in the page via the _host.cshtml
but I get an exception when I click my button
Exception has occurred: CLR/Microsoft.JSInterop.JSException
Exception thrown: 'Microsoft.JSInterop.JSException' in System.Private.CoreLib.dll:
'Document is not focused.
undefined'
at System.Threading.Tasks.ValueTask1.get_Result() at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__161.MoveNext()
at System.Threading.Tasks.ValueTask`1.get_Result()
at CurrieTechnologies.Razor.Clipboard.ClipboardService.d__4.MoveNext()
at blazorWeb.Pages.Clipboard.d__2.MoveNext() in C:\Data\Dev\MDTinfo3\blazorWeb\Pages\Clipboard.razor:line 32
Is this "document not focused" the reason you had to use a lambda function, or should my code work?
The text was updated successfully, but these errors were encountered:
In a blazor server app I've tried to use a "normal" function to access the clipboard, instead of the lambda function per your example
@page "/Clipboard"
@using CurrieTechnologies.Razor.Clipboard
@Inject ClipboardService clipboard
cliptest
<button @OnClick="myfunc">myfunc
@code
private async void myfunc(MouseEventArgs e) {
string a = await clipboard.ReadTextAsync();
}
your minified js is included in the page via the _host.cshtml
but I get an exception when I click my button
Exception has occurred: CLR/Microsoft.JSInterop.JSException
Exception thrown: 'Microsoft.JSInterop.JSException' in System.Private.CoreLib.dll:
'Document is not focused.
undefined'
at System.Threading.Tasks.ValueTask
1.get_Result() at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__16
1.MoveNext()at System.Threading.Tasks.ValueTask`1.get_Result()
at CurrieTechnologies.Razor.Clipboard.ClipboardService.d__4.MoveNext()
at blazorWeb.Pages.Clipboard.d__2.MoveNext() in C:\Data\Dev\MDTinfo3\blazorWeb\Pages\Clipboard.razor:line 32
Is this "document not focused" the reason you had to use a lambda function, or should my code work?
The text was updated successfully, but these errors were encountered: