Skip to content

Commit 4f19d7e

Browse files
committedApr 30, 2024··
fix: partial should not include div.id = counter
1 parent acc8fd4 commit 4f19d7e

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed
 

‎samples/MinimalHtmxorApp/Components/Pages/Counter.razor

+11-9
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@
1111
content, like these paragraph elements.
1212
</p>
1313

14-
<HtmxPartial>
15-
<div id="counter">
14+
<div id="counter">
15+
<HtmxPartial>
1616
<p role="status">
1717
Current count: @CurrentCount
1818
</p>
19-
<button class="btn btn-primary"
20-
hx-put="/counter"
19+
<button class="btn btn-primary"
20+
hx-put="/counter"
2121
hx-vals='{ "CurrentCount": @(CurrentCount) }'
22-
hx-target="#counter"
23-
@onput="IncrementCount">Click me</button>
24-
</div>
25-
</HtmxPartial>
22+
hx-target="#counter"
23+
@onput="IncrementCount">
24+
Click me
25+
</button>
26+
</HtmxPartial>
27+
</div>
2628

2729
@code {
2830
[SupplyParameterFromForm]
@@ -33,7 +35,7 @@
3335
// Access the HtmxContextEventArgs to control
3436
// the response headers to the client.
3537
// E.g.: args.Response.StatusCode(201);
36-
38+
3739
CurrentCount++;
3840
}
3941
}

0 commit comments

Comments
 (0)
Please sign in to comment.