1

I'm having a hard time focusing an input field in the drop down menu of Twitter Bootstrap. My html markup is as follows:

<div class="btn-group">
  <button class="btn dropdown-toggle" data-toggle="dropdown">
    Groups <span class="caret"></span>
  </button>
  <ul class="dropdown-menu">
     <li><a href="#">Friends <i class="icon-ok pull-right"></i></a></li>
     <li><a href="#">Family <i class="icon-ok pull-right"></i></a></li>
     <li><a href="#">Other</a></li>
     <li class="divider" />
     <li><input type="text" class="input-block-level" placeholder="New group" /></li>
  </ul>
</div>

I've also created a jsFiddle for this: http://jsfiddle.net/Yppqw/2/

Can please tell me how to keep the drop down visible when focusing the input field

Tim Skauge
  • 1,814
  • 2
  • 23
  • 35

2 Answers2

1

Try adding a 'dropdown' class to your element with 'the btn-group' class

You can probably remove that btn-group class unless you plan on having other buttons next to this one.

Alan Jenkins
  • 344
  • 2
  • 8
-1

Try this

<div class="dropdown inputdropdown">
                  <input class="searchformss dropdown-toggle" type="text" data-toggle="dropdown" placeholder="test" />
                  <div class="dropdown-menu">
                    <a class="dropdown-item">test</a>
                    <a class="dropdown-item">Another action</a>
                    <a class="dropdown-item">Something else here</a>
                  </div>
                </div>