From 0f3b0aaa0b9e6523dc839d93c83f56de179746a0 Mon Sep 17 00:00:00 2001 From: "hossein k.j" Date: Mon, 9 Sep 2024 11:08:02 +0330 Subject: [PATCH] Update HtmxFragment.cs Hi Mr Egil I change ShouldOutput method because Match?.Invoke(context.Request) ?? true must be done just when context.Request.RoutingMode is RoutingMode.Direct because RenderDuringStandardRequest has higher priority in RoutingMode.Standard --- src/Htmxor/Components/HtmxFragment.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Htmxor/Components/HtmxFragment.cs b/src/Htmxor/Components/HtmxFragment.cs index 6df897d..420570d 100644 --- a/src/Htmxor/Components/HtmxFragment.cs +++ b/src/Htmxor/Components/HtmxFragment.cs @@ -43,5 +43,5 @@ protected override void BuildRenderTree([NotNull] RenderTreeBuilder builder) /// public override bool ShouldOutput([NotNull] HtmxContext context, int directConditionalChildren, int conditionalChildren) => (RenderDuringStandardRequest && context.Request.RoutingMode is RoutingMode.Standard) - || (Match?.Invoke(context.Request) ?? true); + || ((Match?.Invoke(context.Request) ?? true && context.Request.RoutingMode is RoutingMode.Direct)); }