question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dropdowns shown incorrectly

See original GitHub issue

Bug description:

My dropdowns won’t work - neither the bootstrap-standard-dropdowns, nor the ng-bootstrap-dropdowns… The dropdown is ‘opened’ from the beginning and is shown very uncommon. If I press the toggle-button, nothing happens. The classes of the dropdown-items aren’t even changed.

Link to minimally-working StackBlitz that reproduces the issue:

That’s the problem. I can’t reproduce the problem. The stackblitz shows my scenario nonetheless… https://stackblitz.com/edit/angular-pvq85f --> modal - in the modal is a dropdown

It looks like the script-side of ng-bootstrap isn’t working, but I don’t know why… image

<div class="modal-content">
  <div class="modal-header">
    <div>
     TITLE
    </div>
    <button type="button" class="icon-button" (click)="activeModal.close()">
      <i class="icon icon-delete" aria-hidden="true"></i>
    </button>
  </div>
  <div class="modal-body">
    <div>
      <div class="form-group row">
        <p class="col-4 text">{{'Priority'|translate}}</p>
        <div class="col-8 no-padding">
          <div class="col">
            <div ngbDropdown class="d-inline-block">
              <button class="btn btn-outline-primary" id="dropdownBasic1" ngbDropdownToggle>Toggle dropdown</button>
              <div ngbDropdownMenu aria-labelledby="dropdownBasic1">
                <button ngbDropdownItem>Action - 1</button>
                <button ngbDropdownItem>Another Action</button>
                <button ngbDropdownItem>Something else is here</button>
              </div>
            </div>
          </div>

        </div>
      </div>
    </div>
  </div>
  <div class="modal-footer ">
    <button type="button" class="normal-button" (click)="submit()">
     FOOTER
    </button>
  </div>
</div>

My angular.json

image

My index.html

image

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 9.0.6

ng-bootstrap: 6.0.0

Bootstrap: 4.4.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marriskleinertcommented, Mar 18, 2020

Alright, so I did that and everything worked fine. I think, something in my app is wrong or so. It’s been a while since it was created and there have been many updates etc… But thank you anyways for helping out. I think I have to start from scratch in near future.

0reactions
benouatcommented, Mar 18, 2020

Ok, then 😄 Could you try to create a blank new project from Angular CLI, then manually (following our documentation) add ng-bootstrap, and finally try the broken pattern.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The problem with dropdown fields (and what you should use ...
In this article, I'm going to talk about the advantages and disadvantages of using dropdowns, show you how to pick a better input...
Read more >
Dropdown showing incorrect data - Power Platform Community
Solved: I have a dropdown input control and the control settings are: Items: Distinct('Check Statuses','Check Statuses') Where Check ...
Read more >
Dropdown filter is showing incorrect result in React
The display should show the result as per the values selected in checkboxes and dropdown. While checkboxes are working well and displaying ...
Read more >
Excel Data Validation Tips and Troubleshooting - Contextures
Drop down not working, blank selected, not showing all data. ... Here's the most common cause for that problem, and how to fix...
Read more >
Incorrect cursor showing in dropdown menu - HTML & CSS
Why is my cursor the text select button when its suppose to be the link click cursor when I click the dropdown menu...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found