bootstrap-material-design icon indicating copy to clipboard operation
bootstrap-material-design copied to clipboard

Checkboxes and radio not working?

Open ghost opened this issue 12 years ago • 21 comments

After adding the package, everything went material, but for some reason checkboxes and radio buttons don't show up at all, despite having the right classes (class="checkbox" for example) on the container divs. I'm using autoform for the actual forms, with boostrap 3 theme.

ghost avatar Nov 03 '14 12:11 ghost

take a look at: https://github.com/FezVrasta/bootstrap-material-design/issues/15

this explains why.

regards roman

stachrom avatar Nov 04 '14 09:11 stachrom

Yeah, I found that, in the end. Has anyone found some kind of Meteor workaround for this? I tried calling $.material.checkbox() in Template.rendered, but that doesn't seem to work as $.material is undefined... (so I assume my approach is completely wrong)

ghost avatar Nov 04 '14 09:11 ghost

What we need to do, is exchange the functionality from arrive.js.

https://github.com/FezVrasta/bootstrap-material-design/blob/master/scripts/material.js#L120

stachrom avatar Nov 04 '14 10:11 stachrom

Add arrive.js to your project as the first file imported, you're missing the dependency?

Can't seem to find the same files that you did in your package...was going to fork but meh.

If you add arrive.js then the radios and checkboxes will work just fine.

Amdingo avatar Nov 08 '14 03:11 Amdingo

Could someone outline how to include the arrive.js in Meteor?

neopostmodern avatar Nov 09 '14 13:11 neopostmodern

you can slap it in your lib, but I believe that the packages will load before that anyway.

Ideally html5cat would include the files that he used to build the package, and then I could fork it and include arrive.js and rebuild the package, or html5cat could go ahead and do that themselves and retain the functioning version on atmosphere.js. I went looking through Fez's build and it looks like there are subtle differences that I don't want to attempt to recreate.

If you want to test it yourself to see the checkboxes working you can load up a project and then dive down to the package js and insert the entirety of arrive.js after the imports, and refresh your project within the browser. Note that meteor reverifies and downloads the correct js which will override the changes that you made, and that you'll have to overwrite the file each time you want to see the functionality. Seems like the only that doesn't work after including arrive.js is the flyaway text.

http://pastebin.com/C2PNF5BD

Amdingo avatar Nov 09 '14 17:11 Amdingo

Latest version seems to have checkbox styled. Let me know if this needs more attention.

Thanks!

html5cat avatar Nov 15 '14 01:11 html5cat

I updated to 0.1.4, but checkboxes and radio buttons still don't work. I'm also using Autoform 4, if that helps.

ghost avatar Nov 17 '14 09:11 ghost

@DigitalAndre could you through a reproduction case via http://meteorpad.com/ ?

html5cat avatar Nov 18 '14 08:11 html5cat

I can try - we have so many packages loaded in now that it's going to be hard to figure out what to include, and what not to... I'll try to make a "naked" Meteor app with mizzao:bootstrap-3 and bootstrap-material and see if it works, and backtrack from there...

ghost avatar Nov 18 '14 10:11 ghost

I tried adding arrive.js to the lib folder, but it threw an error: HTMLElement not defined. However, adding $.material.radio() to the template rendered function worked.

rhythnic avatar Dec 09 '14 15:12 rhythnic

Hey guys,

@html5cat asked me to help with integrating this theme with Meteor, so I've submitted a PR directly to @fezvrasta that will enable him to publish updates as he releases them. There is a pretty comprehensive test suite so please let me know if you still see any problems (a screenshot would help).

You can already use the package from Atmosphere:

meteor add fezvrasta:bootstrap-material-design

Thanks again to Yuri for making this theme available for Meteor and so popular.

dandv avatar Dec 15 '14 15:12 dandv

merged, now I just need to figure out how it works :P

FezVrasta avatar Dec 15 '14 15:12 FezVrasta

:+1: Thanks @FezVrasta :) Closing this -

Everyone else, if there are further issues, please file a ticket in FezVrasta's repo, and he'll helpfully add the meteor label.

dandv avatar Dec 15 '14 15:12 dandv

I'll add the label and then someone will take care of it because I really really really don't know anything about this thing :yum:

FezVrasta avatar Dec 15 '14 16:12 FezVrasta

I will, as the README says :)

dandv avatar Dec 15 '14 16:12 dandv

BTW @DigitalAndre, the best-maintained Bootstrap package is the official community integration, twbs:bootstrap.

dandv avatar Dec 15 '14 16:12 dandv

Added the label, and even a tiny symbol that should represent a meteor :|

image

Improvements are welcome ahahah

FezVrasta avatar Dec 15 '14 16:12 FezVrasta

M̹̥͉͎͝O̢͚̻͇S̖̳̻͔̘T͓͈͝ ҉̻̠͙̩̹̙̫A͞W̟̞̜̯̙E̪̫SƠ̺̜̲̩ͅͅM͕E͖̼̤͖̥̠̫ ̷̙̗̞͇̤͈̯Ḽ̡͚̦̗̦̺̪A̖̱̖ͅB͔̀E̥̳̹̩̟̱L̷̞͍ ͉̹̰̮F͏̳̞͖͕̳T͍̳͠Ẁ̦͎̱͓̯!̦̗̣

dandv avatar Dec 15 '14 16:12 dandv

@dandv is that better than mizzao's? Only that one seems to come higher on atmo's search results, but maybe that's meaningless. (Bit of a Meteor noob here...) Thanks for the tips and all the help - I'll try with twbs:bootstrap and fezvrasta:bootstrap-material-design

ghost avatar Dec 16 '14 09:12 ghost