Skip to content

Commit 9dc63ef

Browse files
committed
Fix bottom sheet
1 parent 597b7d3 commit 9dc63ef

File tree

4 files changed

+258
-208
lines changed

4 files changed

+258
-208
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@page "/counter"
22

3-
<h1>Counter</h1>
3+
<div data-bs-header><h1>Counter</h1></div>
44

55
<p role="status">Current count: @currentCount</p>
66

7-
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
7+
<button class="btn btn-primary" @onclick="OnClick">Click me</button>
88

99

1010
@code {
@@ -14,4 +14,7 @@
1414
{
1515
currentCount++;
1616
}
17+
18+
[Parameter]
19+
public EventCallback OnClick { get; set; }
1720
}

src/GenOne.Blazor.BottomSheet/demo/BlazorHybrid/Pages/FetchData.razor

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ else
2323
</tr>
2424
</thead>
2525
<tbody data-bs-content>
26+
<div data-bs-watch />
2627
@foreach (var forecast in forecasts)
2728
{
2829
<tr>
@@ -32,9 +33,11 @@ else
3233
<td>@forecast.Summary</td>
3334
</tr>
3435
}
35-
<tr data-bs-footer>
36-
<td>Footer</td>
37-
</tr>
36+
<tr data-bs-footer>
37+
<td>
38+
<button @onclick="OnClick">click</button>
39+
</td>
40+
</tr>
3841
</tbody>
3942
</table>
4043
}
@@ -46,4 +49,7 @@ else
4649
{
4750
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
4851
}
52+
53+
[Parameter]
54+
public EventCallback OnClick { get; set; }
4955
}

src/GenOne.Blazor.BottomSheet/demo/BlazorHybrid/Pages/Index.razor

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@ Times closed: @_closedCount;
99
<button @onclick="OpenSheet">Open Sheet</button>
1010

1111
<BottomSheetBlazorJs @ref="_sheet" Sensitivity="5" Stops="new[] { 95 }" OnClosed="() => _closedCount++">
12-
<FetchData></FetchData>
12+
@if (isTrue)
13+
{
14+
<Counter OnClick="Test" />
15+
}
16+
else
17+
{
18+
<FetchData OnClick="Test" />
19+
}
1320
</BottomSheetBlazorJs>
1421

1522

1623
@code
1724
{
1825
private BottomSheetBlazorJs? _sheet;
26+
private bool isTrue = false;
1927

2028
private int _closedCount;
2129

@@ -26,4 +34,9 @@ Times closed: @_closedCount;
2634

2735
await _sheet.Open();
2836
}
37+
38+
private void Test()
39+
{
40+
isTrue = !isTrue;
41+
}
2942
}

0 commit comments

Comments
 (0)