Skip to content

Commit 36ec003

Browse files
committed
Fix AttachCustomWheelEventHandler error in frontend.
blazor.server.js:1 Uncaught (in promise) Error: System.ArgumentException: The assembly 'XtermBlazor' does not contain a public invokable method with [JSInvokableAttribute("AttachCustomWheelEventHandler")]. at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.GetCachedMethodInfo(:5001/AssemblyKey assemblyKey, String methodIdentifier) at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(:5001/JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson) at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(:5001/JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson) at y.endInvokeDotNetFromJS (blazor.server.js:1:3502) at Xt._invokeClientMethod (blazor.server.js:1:61001) at Xt._processIncomingData (blazor.server.js:1:58476) at Xt.connection.onreceive (blazor.server.js:1:52117) at s.onmessage (blazor.server.js:1:80262)
1 parent c3598a2 commit 36ec003

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

XtermBlazor/XtermHandler.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,18 @@ public static bool AttachCustomKeyEventHandler(string id, KeyboardEventArgs @eve
188188
return GetTerminal(id)?.CustomKeyEventHandler.Invoke(@event) ?? true;
189189
}
190190

191+
/// <summary>
192+
/// An event handler before wheel are processed
193+
/// </summary>
194+
/// <param name="id"></param>
195+
/// <param name="event"></param>
196+
/// <returns></returns>
197+
[JSInvokable]
198+
public static bool AttachCustomWheelEventHandler(string id, WheelEventArgs @event)
199+
{
200+
return GetTerminal(id)?.CustomWheelEventHandler.Invoke(@event) ?? true;
201+
}
202+
191203
private static Xterm? GetTerminal(string id)
192204
{
193205
return _terminals.ContainsKey(id) ? _terminals[id] : null;

0 commit comments

Comments
 (0)