Bootstrap: empty dropdown still makes dropdown

Created on 13 Feb 2018  路  11Comments  路  Source: twbs/bootstrap

ISSUE:
When dropdown-menu is empty (without any dropdown-item) it still shows a very tight empty square.
it should be removed (or not created in first place) if there are no items, just like collapse does.

FIX:
dropdown-menu should show dropdown-items only when there are actual dropdown-items to show (just like collapse does with its elements).

Example:
I'm making search bar to show suggestions, it works wonderful with Bootstrap 4.0.0 dropdown but before you start writing it already shows the empty tight square (this is dropdown-menu without any dropdown-item yet):

empty dropdown

tested on:

  • Microsft Edge 41.16299.15.0
  • Google Chrome 64.0.3282.140
css v4

Most helpful comment

Simple css fix, using original bootstrap links, just add a new