Skip to content

Commit d8e09e4

Browse files
authored
fix: change HtmxFragment.ShouldRender on direct requests
The ShouldOutput method should only check Match?.Invoke(context.Request) when context.Request.RoutingMode is RoutingMode.Direct because RenderDuringStandardRequest has higher priority in RoutingMode.Standard.
1 parent 6b86cfc commit d8e09e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Htmxor/Components/HtmxFragment.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ protected override void BuildRenderTree([NotNull] RenderTreeBuilder builder)
4343
/// <inheritdoc/>
4444
public override bool ShouldOutput([NotNull] HtmxContext context, int directConditionalChildren, int conditionalChildren)
4545
=> (RenderDuringStandardRequest && context.Request.RoutingMode is RoutingMode.Standard)
46-
|| (Match?.Invoke(context.Request) ?? true);
46+
|| ((Match?.Invoke(context.Request) ?? true && context.Request.RoutingMode is RoutingMode.Direct));
4747
}

0 commit comments

Comments
 (0)