Page 1 of 1

ListItem onclick is activated by click on a Toogle component

Posted: Sat Aug 22, 2015 2:11 pm
by Giorgio Draghetti

Image

I have a Toggle component inside the content area of a Collapsible that is inside a ListItem (see image).
When i click the Toggle component, will be activated the onclick event of the ListItemComponent. I don't want this happen.

Is it possible to overcome this behaviour?


ListItem onclick is activated by click on a Toogle component

Posted: Sun Aug 23, 2015 7:59 am
by Serhii Kulibaba

This is bubbling effect: http://javascript.info/tutorial/bubbl...

You can write some storage variable on toggle's click event and check it on listitem's click event. E.g. run JS only if this value=false