Skip to content

Latest commit

 

History

History
54 lines (46 loc) · 1.21 KB

README.md

File metadata and controls

54 lines (46 loc) · 1.21 KB

bootstrap-dropdown-control

Provides support for placing form-elements in Bootstrap dropdowns

Features

  • prevents bootstrap dropdown from hiding when clicking inside
  • automatically focus the first visible form element when the dropdown is shows up
  • close dropdown on blur when the new active element is not in dropdown content

Examples

Javascript initialization

$('.dropdown-control').dropdownControl({
  showOnFocus: true, 
  focusInput: true
})

Markup

<div class="btn-group">
  <button type="button" class="btn btn-default dropdown-toggle dropdown-control">
     Filters <span class="caret"></span>
  </button>
  <div class="dropdown-menu" role="menu">
    <div class="form-group">
      <input type="text" class="form-control">
    </div>
  </div>
</div>

Options

NameDescriptionDefault
focusInputautomatic focus first elementfalse
showOnFocusautomatically opens the dropdown on focusfalse

Example Demo

http://rawgithub.com/benignware/bootstrap-dropdown-control/master/examples/index.html