Grid: AllowDetailView and AllowRowClick Conflict when enabled together
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Empieza por la gestión de los clics en las filas y los eventos de la vista de detalle del componente Grid; después, sigue cómo los clics en el botón de expansión llegan a OnRowClick. Reproduce el comportamiento con ambas opciones habilitadas y confirma que el botón de expansión sigue abriendo la vista de detalle sin invocar el callback de clic en la fila.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- HTML
- Estrellas
- 1.2k
- Forks
- 111
- Merge medio
- 4 min
- PR fusionados (30 d)
- 55
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de vikramlearning/blazorbootstrap
-
NET 11 SupportAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 28/100
vikramlearning/blazorbootstrap#1362 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
vikramlearning/blazorbootstrap#1346 ·
Los mantenedores suelen responder en 1 día
-
Showcase: rich sample websites built with Blazor BootstrapPosiblemente ocupada @gvreddy04 la tomó hace 8 días. Abierto
vikramlearning/blazorbootstrap#1343 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[New Component] TreeViewAbiertoarea-tree-view new component
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/100
vikramlearning/blazorbootstrap#1339 ·
Los mantenedores suelen responder en 1 día
-
area-autocomplete area-forms area-multi-select new component
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
vikramlearning/blazorbootstrap#1338 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vikramlearning/blazorbootstrap
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DioxusLabs/blitz#1614 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
boxlite-ai/boxlite#2777 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
quality-assurance
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Paul-Austin-Oswego-CSC480-HCI521/gift-app#249 ·
Los mantenedores suelen responder en 1 día
-
bug P3
Dificultad 1/5 Menos de una hora Aptitud para principiantes 87/100
Los mantenedores suelen responder en 1 día