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

Dropdown menu isn't opening #180

Open
alexsouzabh opened this issue Oct 27, 2019 · 4 comments
Open

Dropdown menu isn't opening #180

alexsouzabh opened this issue Oct 27, 2019 · 4 comments

Comments

@alexsouzabh
Copy link

alexsouzabh commented Oct 27, 2019

Hi, I tried to use this GEM in distinct SO (Windows and Linux), tried to look at google but I'm not able to resolve. I create a dropdown menu, it's showed in Browser but I'm not able to open.
I'm running
rails: 6.0.0
ruby: 2.6.5p114
Ubuntu 16.04.6 LTS

An example that I'm using

<div class="dropdown">
  <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
    Dropdown button
  </button>
  <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
    <a class="dropdown-item" href="#">Action</a>
    <a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>
  </div>
</div>

Thank you!

@estani
Copy link

estani commented Apr 16, 2020

Probably using the wrong bootstrap version / html code.
Copy paste the bootstrap example of dropdown for the version of your gem and it should work.
Then check the differences with your code
(I had to change the html structure when moving from bootstrap 3 to 4)

@bswinnerton
Copy link

I was running into this with the following error in the console:

bootstrap.js:1498 Uncaught TypeError: Cannot convert object to primitive value
    at RegExp.test (<anonymous>)
    at HTMLDivElement.<anonymous> (bootstrap.js:1498)
    at Function.each (jquery.js:325)
    at jQuery.fn.init.each (jquery.js:165)
    at jQuery.fn.init._jQueryInterface [as collapse] (bootstrap.js:1492)
    at HTMLDivElement.<anonymous> (bootstrap.js:1552)
    at Function.each (jquery.js:325)
    at jQuery.fn.init.each (jquery.js:165)
    at HTMLButtonElement.<anonymous> (bootstrap.js:1547)
    at HTMLDocument.dispatch (jquery.js:4670)

Downgrading to jQuery 3.4.1 worked for me. More information can be found here.

@mystycs
Copy link

mystycs commented May 4, 2020

Dropdown also isnt working here, but your solution didnt work for me. @alexsouzabh have you had any luck?

@aj-leal
Copy link

aj-leal commented Sep 3, 2020

for those looking for solution to this, I found a work around for this problem. Follow the steps from here and the dropdown will work using the code template for bootstrap 4.

Hope this helps!

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

5 participants