diff --git a/src/Components/Ignitor/src/BlazorClient.cs b/src/Components/Ignitor/src/BlazorClient.cs index 46637eb3bb..f690569228 100644 --- a/src/Components/Ignitor/src/BlazorClient.cs +++ b/src/Components/Ignitor/src/BlazorClient.cs @@ -333,11 +333,12 @@ namespace Ignitor return null; } - public async Task ConnectAsync(Uri uri, bool connectAutomatically = true) + public async Task ConnectAsync(Uri uri, bool connectAutomatically = true, Action? configure = null) { var builder = new HubConnectionBuilder(); builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton()); - builder.WithUrl(GetHubUrl(uri)); + var hubUrl = GetHubUrl(uri); + builder.WithUrl(hubUrl); builder.ConfigureLogging(l => { l.SetMinimumLevel(LogLevel.Trace); @@ -347,6 +348,8 @@ namespace Ignitor } }); + configure?.Invoke(builder, hubUrl); + _hubConnection = builder.Build(); HubConnection.On("JS.AttachComponent", OnAttachComponent); diff --git a/src/Components/Ignitor/src/ElementHive.cs b/src/Components/Ignitor/src/ElementHive.cs index 34d128ecc5..b7819b4276 100644 --- a/src/Components/Ignitor/src/ElementHive.cs +++ b/src/Components/Ignitor/src/ElementHive.cs @@ -264,8 +264,14 @@ namespace Ignitor case RenderTreeFrameType.ElementReferenceCapture: { - // No action for reference captures. - break; + if (parent is ElementNode) + { + return 0; // A "capture" is a child in the diff, but has no node in the DOM + } + else + { + throw new Exception("Reference capture frames can only be children of element frames."); + } } case RenderTreeFrameType.Markup: diff --git a/src/Components/Ignitor/src/ElementNode.cs b/src/Components/Ignitor/src/ElementNode.cs index 06126cf42e..8290198ecf 100644 --- a/src/Components/Ignitor/src/ElementNode.cs +++ b/src/Components/Ignitor/src/ElementNode.cs @@ -88,7 +88,7 @@ namespace Ignitor return DispatchEventCore(connection, Serialize(webEventDescriptor), Serialize(args)); } - internal Task ClickAsync(HubConnection connection) + public Task ClickAsync(HubConnection connection) { if (!Events.TryGetValue("click", out var clickEventDescriptor)) {