Topic: Opening the row dropdown also navigates to the details page
AdaFrontend
free
asked 1 week ago
The entire table row is clickable and opens a customer details page. We placed an action dropdown in the final cell, but clicking its trigger now opens the dropdown briefly and immediately navigates away.
The navigation handler is attached to the row's click event. The trigger is a button with type set to button. Can the action cell stay interactive without activating the row navigation?
Arkadiusz Idzikowski
staff
answered 1 week ago
The click is bubbling from the trigger through the action cell to the row. Stop that propagation at the action cell while keeping the trigger's own dropdown binding intact. type=button prevents form submission, but it does not stop a click from reaching ancestors.
For keyboard accessibility, consider a dedicated link in the customer-name cell instead of making the entire row the only navigation control. Test the dropdown and its actions with the keyboard after adding the propagation boundary.
<td (click)="$event.stopPropagation()">
<!-- Keep the existing dropdown trigger and menu here. -->
</td>
https://mdbootstrap.com/docs/angular/components/dropdowns/
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: MDB5 9.1.0
- Device: Desktop
- Browser: Firefox
- OS: Windows 11
- Provided sample code: No
- Provided link: No