Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working inside a dynamically generated content #10

Open
reisfira opened this issue Apr 6, 2020 · 2 comments
Open

not working inside a dynamically generated content #10

reisfira opened this issue Apr 6, 2020 · 2 comments

Comments

@reisfira
Copy link

reisfira commented Apr 6, 2020

Using Bootstrap 4.0, icheck-bootstrap from AdminLTE3

I have a modal that is cloned and triggered on click like so:

$('body').on('click', '.btn-modal-add-resource', function() {
        let modal = $('.resource-modal-template').clone().removeClass('.resource-modal-template')

        modal.modal()
        modal.on('hidden.bs.modal', function (e) { $(this).remove() })
})

and within that modal I have the html code:

<div class="form-group">
    <div class="icheck-primary">
        <input type="radio" id="someRadioId1" name="someGroupName" />
        <label for="someRadioId1">Option 1</label>
    </div>
    <div class="icheck-primary">
        <input type="radio" id="someRadioId2" name="someGroupName" />
        <label for="someRadioId2">Option 2</label>
    </div>
</div>

the radio button cannot be clicked. unless I removed the icheck-primary class and follow the normal radio button from bootstrap - but that'd be without the style.. normally for this kind of issue is about initializing the element from javascript. but this library is fully css

@pp1543
Copy link

pp1543 commented May 25, 2021

I used this workaround to get it working:

/* fix icheck dynamically inserted */
[class*="icheck-"] > input {
z-index: 1;
cursor: pointer;
width: 22px;
height: 22px;
}

@TheMaverickProgrammer
Copy link

I used this workaround to get it working:

/* fix icheck dynamically inserted */
[class*="icheck-"] > input {
z-index: 1;
cursor: pointer;
width: 22px;
height: 22px;
}

wow this works for me on vuejs too. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants