garth / snabbdom-material

Stateless UI components for snabbdom that follow material design
http://garth.github.io/snabbdom-material/
MIT License
49 stars 6 forks source link

Buttons using primary not getting updated #12

Closed delaneyj closed 8 years ago

delaneyj commented 8 years ago

Have a section of code like this

const {page} = state;
<Button flat primary={page ==='about'} onClick={()=>signals.pageChange('about')}><Icon>home</Icon> About</Button>
<Button flat primary={page ==='guide'} onClick={()=>signals.pageChange('guide')}><Icon>map</Icon> Guide</Button>
<Button flat primary={page ==='legal'} onClick={()=>signals.pageChange('legal')}><Icon>gavel</Icon> Legal</Button>

And it starts out looking correct, however as I start clicking the buttons and signals get sent the primary color stays and is not reset to initial color. Is there something missing or does it have to do with snabbdom's diffing?

garth commented 8 years ago

Can you let me know it it's still happening with the latest version (1.3), I've just made a big refactor of class handling to work around some issues with the way the snabbdom class plugin works.

delaneyj commented 8 years ago

Yes its still happening in 1.3, also you introduced a peer undeclared dependency on classnames module.