telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
467 stars 217 forks source link

[Grid] [TreeList] Component events are triggered on cell button click #4207

Open mbechev opened 8 months ago

mbechev commented 8 months ago

Describe the bug

Clicking a Kendo Angular Button or kendoGridRemoveCommand (kendoTreeListRemoveCommand) button, defined in kendoGridCellTemplate (respectively kendoTreeListCellTemplate) triggers component events - cellClick, selectionChange, seletedKeysChange.

The events are emitted only when clicking the text of the button (inner span element with class="k-button-text"). Clicking the surrounding area of the text (highlighted below) triggers only the click event of the button:

image

To Reproduce Open the console and click the Test or Remove button Grid - https://stackblitz.com/edit/angular-vjjkzx TreeList - https://stackblitz.com/edit/angular-5axwa3

Expected behavior The custom buttons should not trigger other component events just click event.

slavenai commented 7 months ago

Workaround Stopping the click event's propagation will prevent other Grid events from emitting: https://stackblitz.com/edit/angular-vjjkzx-x6ajgo?file=src%2Fapp%2Fapp.component.ts