Grid: AllowDetailView and AllowRowClick Conflict when enabled together
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu bằng cách xem cách thành phần Grid xử lý lượt nhấp vào hàng và sự kiện của chế độ xem chi tiết, sau đó theo dõi cách lượt nhấp vào nút mở rộng đến OnRowClick. Tái hiện hành vi với cả hai tùy chọn được bật và xác nhận rằng nút mở rộng vẫn mở chế độ xem chi tiết mà không gọi callback nhấp vào hàng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
In the Grid component, setting both AllowDetailView and AllowRowClick to true causes both behaviors to be triggered when a row is clicked, resulting in unexpected behavior.
To Reproduce
- Add a Grid component.
- Set AllowRowClick="true" and OnRowClick="SomeFunction".
- Set AllowDetailView="true".
- Build and run the application, then click the Grid’s expand button.
- The row expands, and the OnRowClick behavior is triggered at the same time.
Expected behavior
When both AllowDetailView and AllowRowClick are enabled, clicking the expand button on the left should not trigger OnRowClick.
Alternatively, if this is the expected behavior, an exception should be thrown when both options are enabled.
Using OnRowDoubleClick works around the issue, but it doesn’t provide a good user experience.
Versions:
- .NET Version: .NET 10
- BlazorBootstrap: 4.0.0
- Blazor WebAssembly / Server: Server
- Blazor Interactive Render Mode: Server
- Blazor Interactivity Location: Global
Sample code
@page "/Test"
@attribute [StreamRendering]
<Grid TItem="string" Class="table table-bordered" DataProvider="GridDataProviderAsync" OnRowClick="OnRowClick" AllowRowClick="true" AllowDetailView="true">
<GridColumn TItem="string" HeaderText="Text" PropertyName="text" SortKeySelector="item => item">
@context
</GridColumn>
<GridDetailView TItem="string">
<Grid TItem="string" Class="table table-bordered" Data="@(new[] { context })">
<GridColumn TItem="string" Context="text" HeaderText="Head" PropertyName="Head">
@text.Substring(0, 1)
</GridColumn>
<GridColumn TItem="string" Context="text" HeaderText="Tail" PropertyName="Tail">
@text.Substring(text.Length - 1, 1)
</GridColumn>
<GridColumn TItem="string" Context="text" HeaderText="Length" PropertyName="Length">
@text.Length
</GridColumn>
</Grid>
</GridDetailView>
</Grid>
@code
{
[Inject]
public required NavigationManager NavManager { get; set; }
private async Task<GridDataProviderResult<string>> GridDataProviderAsync(GridDataProviderRequest<string> request)
{
var random = new Random();
var data = Enumerable.Range(0, 100).Select(_ => new string(Enumerable.Range(0, 8).Select(__ => (char)random.Next('A', 'Z' + 1)).ToArray())).ToList();
return request.ApplyTo(data);
}
private void OnRowClick(GridRowEventArgs<string> args)
{
var uri = $"https://google.com/search?q={args.Item}";
NavManager.NavigateTo(uri);
}
}
Desktop:
- OS: Windows 11
- Browser: Edge
- Version: 157
- Ngôn ngữ chính
- HTML
- Star
- 1.2k
- Fork
- 111
- Merge trung bình
- 4 phút
- Pull request đã merge (30 ngày)
- 55
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vikramlearning/blazorbootstrap
-
NET 11 SupportĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 28/100
vikramlearning/blazorbootstrap#1362 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
vikramlearning/blazorbootstrap#1346 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Showcase: rich sample websites built with Blazor BootstrapCó thể đã có người làm @gvreddy04 đã nhận 8 ngày trước. Đang mở
vikramlearning/blazorbootstrap#1343 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[New Component] TreeViewĐang mởarea-tree-view new component
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
vikramlearning/blazorbootstrap#1339 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area-autocomplete area-forms area-multi-select new component
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
vikramlearning/blazorbootstrap#1338 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vikramlearning/blazorbootstrap
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DioxusLabs/blitz#1614 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
boxlite-ai/boxlite#2777 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
quality-assurance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#249 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P3
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày