Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Hi
As you know, the default type of a button is submit
when the type is not specified in the html. When we nest QuickGrid into a form, it submits the form after clicking a button in the header template. Because these buttons don't have the type attribute:
It should has type
attributes like this:
private void RenderDefaultHeaderContent(RenderTreeBuilder __builder)
{
@if (HeaderTemplate is not null)
{
@HeaderTemplate(this)
}
else
{
@if (ColumnOptions is not null && Align != Align.Right)
{
<button type="button" class="col-options-button" @onclick="@(() => Grid.ShowColumnOptions(this))"></button>
}
if (Sortable.HasValue ? Sortable.Value : IsSortableByDefault())
{
<button type="button" class="col-title" @onclick="@(() => Grid.SortByColumnAsync(this))">
<div class="col-title-text">@Title</div>
<div class="sort-indicator" aria-hidden="true"></div>
</button>
}
else
{
<div class="col-title">
<div class="col-title-text">@Title</div>
</div>
}
@if (ColumnOptions is not null && Align == Align.Right)
{
<button type="button" class="col-options-button" @onclick="@(() => Grid.ShowColumnOptions(this))"></button>
}
}
}
Expected Behavior
The buttons in the default header template should have type attribute with value of button
, so it doesn't submit the parent form.
Steps To Reproduce
Place QuickGrid into a form, then click filter button or column header button to sort.
Exceptions (if any)
No response
.NET Version
dotnet 7
Anything else?
No response
Activity
ghost commentedon Nov 22, 2022
Thanks for contacting us.
We're moving this issue to the
.NET 8 Planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.