Clarity: Datagrid selection. Add 'event.stopPropagation()' to checkbox

Created on 25 Jul 2017  路  3Comments  路  Source: vmware/clarity

Select one ... (check one with "x")

[ ] bug
[ ] feature request
[ x ] enhancement

Expected behavior


Selecting grid row with checkbox should stop event propagation.

Actual behavior


Currently I have event bound to 'clr-dg-row' click that open new page with detailed view.
When selection checkbox clicked - row event triggered as well.

Reproduction of behavior

https://plnkr.co/25RKqC0KOvPtpQWc8F0f

Most helpful comment

@ph55 in addition to the feedback from @adityarb88 above we cannot add event.stopPropagation() to our components.

Clarity components will never, ever prevent event bubbling. We make that guarantee so that Clarity users have access to any events generated in Clarity a component if they need it.

All 3 comments

@ph55: Having a checkbox inside of a clickable row is not a recommended pattern because it is like having a button inside of a button which is not valid according to W3C. More info here: https://stackoverflow.com/a/39386695 & https://github.com/vmware/clarity/issues/476

Closing the issue based on this. Please feel free to reopen the issue if you have any additional questions or feedback. Thanks!

@ph55 in addition to the feedback from @adityarb88 above we cannot add event.stopPropagation() to our components.

Clarity components will never, ever prevent event bubbling. We make that guarantee so that Clarity users have access to any events generated in Clarity a component if they need it.

Hi there 馃憢, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

Was this page helpful?
0 / 5 - 0 ratings