Bootstrap Dropdown menu is not working

后端 未结 18 655
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 23:18

I am having trouble getting my dropdowns to work. I can get the navbar to show up perfectly, but when I click on \"Dropdown\" (either of them) it does not display the dropdo

18条回答
  •  一整个雨季
    2020-12-01 00:02

    Maybe someone out there can benefit from this:

    Summary (a.k.a. tl;dr)

    Bootstrap dropdowns stopped dropping down due to upgrade from django-bootstrap3 version 6.2.2 to 11.0.0.

    Background

    We encountered a similar issue in a legacy django site which relies heavily on bootstrap through django-bootstrap3. The site had always worked fine, and continued to do so in production, but not on our local test system. There were no obvious related changes in the code, so a dependency issue was most likely.

    Symptoms

    When visiting the site on the local django test server, it looked perfectly O.K. at first glance: style/layout using bootstrap as expected, including the navbar. However, all dropdown menus failed to drop down.

    No errors in the browser console. All static js and css files were loaded successfully, and functionality from other packages relying on jquery was working as expected.

    Solution

    It turned out that the django-bootstrap3 package in our local python environment had been upgraded to the latest version, 11.0.0, whereas the site was built using 6.2.2.

    Rolling back to django-bootstrap3==6.2.2 solved the issue for us, although I have no idea what exactly caused it.

提交回复
热议问题