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

Unable to toggle checkbox #4

Open
premregmi opened this issue Mar 20, 2019 · 3 comments
Open

Unable to toggle checkbox #4

premregmi opened this issue Mar 20, 2019 · 3 comments

Comments

@premregmi
Copy link

premregmi commented Mar 20, 2019

This modal plugin is awesome but I am blocked with 1 issue. I can't toggle checkbox inside this popbox. If checked it can not be unchecked and if unchecked I can not make it checked.

<div class="popbox" data-popbox-id="manageGroupModalConfirm">
    <div class="popbox-content bg-white">
      <div class="modal-body">
        <input type="checkbox">
        <div class="custom-control custom-checkbox">
          <label class="custom-control-label" for="manageGroupDontShow">Don’t show this message again</label>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-popbox-close="manageGroupModalConfirm">Ok</button>
      </div>
    </div>
</div>
@Naumov1889
Copy link

I didn't get deep into it but removing e.preventDefault() from the source code (look at the code fragment below) should solve the problem.

....
popboxs[i].addEventListener('click', function(e){
    e.preventDefault();   // <-- remove this line
...

@Voltra
Copy link

Voltra commented May 31, 2023

Technically they'd just have to check if e.currentTarget === popboxs[i] before calling preventDefault. Otherwise yeah, it basically nukes out of existence any click event inside the modal

@Voltra
Copy link

Voltra commented May 31, 2023

Checking e.defaultPrevented would be nice as well to have undesired click event processing

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