Fix delete button click propagation in list views#3304
Merged
Conversation
Added @OnClick:stopPropagation="true" to MudTd elements containing delete buttons to prevent row click events from firing when clicking delete. This fixes the issue where clicking delete would navigate to detail pages instead of showing the confirmation modal. Fixed in: - DeviceModelListPage - EdgeModelListPage - DeviceListPage - EdgeDeviceListPage - ConcentratorListPage - PlanningListPage Co-authored-by: kbeaugrand <9513635+kbeaugrand@users.noreply.github.com>
Added test ClickOnDeleteShouldNotNavigateToDetailsPage to verify that clicking the delete button shows the confirmation dialog without navigating to the detail page. Co-authored-by: kbeaugrand <9513635+kbeaugrand@users.noreply.github.com>
Corrected the element type from MudTh to MudTd for the delete button cell in the RowTemplate. MudTh should only be used in HeaderContent. Co-authored-by: kbeaugrand <9513635+kbeaugrand@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix delete button behavior on device models
Fix delete button click propagation in list views
Jan 31, 2026
kbeaugrand
approved these changes
Jan 31, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3304 +/- ##
=======================================
Coverage 81.06% 81.06%
=======================================
Files 375 375
Lines 14268 14268
Branches 1213 1213
=======================================
Hits 11567 11567
Misses 2338 2338
Partials 363 363 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kbeaugrand
marked this pull request as ready for review
January 31, 2026 12:47
kbeaugrand
enabled auto-merge (rebase)
January 31, 2026 12:47
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where clicking delete buttons in list views would trigger row navigation instead of showing the deletion confirmation modal. The issue occurred because click events were bubbling from the delete button to the row's OnRowClick handler.
Changes:
- Added
@onclick:stopPropagation="true"to delete button cells in 6 list pages to prevent event bubbling - Corrected
MudThtoMudTdin PlanningListPage's RowTemplate - Added test verifying delete button clicks don't trigger navigation
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| DeviceModelListPage.razor | Added stopPropagation to delete button cell to prevent row click navigation |
| EdgeModelListPage.razor | Added stopPropagation to delete button cell to prevent row click navigation |
| DeviceListPage.razor | Added stopPropagation to delete button cell to prevent row click navigation |
| EdgeDeviceListPage.razor | Added stopPropagation to delete button cell to prevent row click navigation |
| ConcentratorListPage.razor | Added stopPropagation to delete button cell to prevent row click navigation |
| PlanningListPage.razor | Added stopPropagation to delete button cell and corrected MudTh to MudTd in RowTemplate |
| DeviceModelListPageTests.cs | Added test to verify delete button click doesn't trigger navigation to details page |
kbeaugrand
approved these changes
Jan 31, 2026
kbeaugrand
disabled auto-merge
January 31, 2026 12:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Delete buttons in list views triggered row click navigation due to event bubbling. Clicking delete would navigate to detail page instead of showing confirmation modal.
Changes:
@onclick:stopPropagation="true"toMudTdcells containing delete buttons in 6 list pages:DeviceModelListPage.razorEdgeModelListPage.razorDeviceListPage.razorEdgeDeviceListPage.razorConcentratorListPage.razorPlanningListPage.razorMudThtoMudTdinPlanningListPageRowTemplateExample:
What kind of change does this PR introduce?
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.