Mdb-ui-kit: radio buttons not showing when using dynamic dom

Created on 13 Sep 2014  路  5Comments  路  Source: mdbootstrap/mdb-ui-kit

Adjusted radio buttons do not always show. I have included the two javascript files from the library, the sequence of the two makes no difference.

In my case this relates to pieces of html (templates) that are added on the fly (via angular). When I start the single page application on a route that directly shows that template all goes well. When it is later shown, it fails.
I'll see if I can make an angular helper for this.

bug confirmed

All 5 comments

seems that the radio button fix in the js is only applied once (at the beginning), and not for newly added elements. So not angular specifc.

the current javascript runs only once so it does not work on dynamic elements, it should be fired everytime the dom is edited... something like this maybe.

http://stackoverflow.com/questions/2844565/is-there-a-jquery-dom-change-listener

Or maybe is better call it manually when an element is added (It's a common practice for this kind of scripts).

By the way the javascript which needs to run every time you add a radio button dynamically adds just two divs which are used by my CSS.

I'm not sure about how Angular works but if you can define the HTML to add beside the radio you could just insert:

<input type=checkbox>
<span class=ripple></span>
<span class=circle></span>
<span class=check></span>

edit I'll try to improve this javascript when I'll come back from vacation.

fixed with fbe6dd3f89fe31b8fa3bf2a49a3ce00f80643d23

Okay @hans-d sorry that implementation was kinda bugged, I've replaced it with this one 13475c58a35ab76238d42e589c139d2a0c3d8f5c

It uses arrive.js, I've not found time to check if my implementation works, please if you have time let me know.

meteor

meteor add modweb:arrive

Was this page helpful?
0 / 5 - 0 ratings

Related issues

migaber picture migaber  路  10Comments

thangchung picture thangchung  路  3Comments

dmwyatt picture dmwyatt  路  3Comments

hashvg7 picture hashvg7  路  4Comments

versedi picture versedi  路  7Comments