Material-ui: Tab panel disappears when selecting checkbox

Created on 1 Jun 2016  路  7Comments  路  Source: mui-org/material-ui

I have a tabs component with multiple tabs inside it, and I have a checkbox component inside one of the tabs' content panels. Whenever I select/deselect the checkbox, all the content of that tab panel just disappears.
The same happens when I use a plain HTML checkbox, and also when I use the material-ui 'Toggle' component'. I haven't tested for other components yet.

Most helpful comment

I've seen this happen as well. Calling event.stopPropagation() from inside the checkbox onCheck handler fixed the issue for me.

All 7 comments

@cynicaldevil do you have a demo or can I look into your source code?

@puranjayjain Where can I post a demo?

@cynicaldevil in a new github repo.

I've seen this happen as well. Calling event.stopPropagation() from inside the checkbox onCheck handler fixed the issue for me.

@brunor It works!!
Thanks a lot, I had been struggling with this issue for quite a while now. Any idea why does this happen, though?

I have the same issue with TextField component. If it's within the Tab, the onChange event on the TextField component will propagate till the Tabs component

I guess we must call event.stopPropagation() in any event inside the Tabs' content.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revskill10 picture revskill10  路  3Comments

reflog picture reflog  路  3Comments

sys13 picture sys13  路  3Comments

FranBran picture FranBran  路  3Comments

mb-copart picture mb-copart  路  3Comments