0

I'm using bootstrap dropdown along with ng-repeat to produce a list but I'm unable to check or uncheck the checkbox inside the div with data-toggle='dropdown'.

Checkbox works, when I remove data-toggle='dropdown'.

 <div class="dropdown" ng-repeat="item in someArray">
     <div class="dropdown-toggle main-title" data-toggle="dropdown">
     <input type="checkbox"/>
     {{item}}
    <span class="caret"></span>
 </div>
3
  • Please post a working code example... Commented Aug 8, 2017 at 15:08
  • Are you using UI Bootstrap ? Commented Aug 8, 2017 at 15:10
  • It seems to works fine, look at this plunker Commented Aug 8, 2017 at 15:16

1 Answer 1

1

The data-toggle is capturing the click and stopping propagation to the checkbox.

Move the input before to the div with data-toggle and it will work fine.

<div class="dropdown" ng-repeat="item in someArray">
    <input type="checkbox"/>
    <div class="dropdown-toggle main-title" data-toggle="dropdown">
        item: {{item}}
        <span class="caret"></span>
    </div>
</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.