Skip to content

rexblack/bootstrap-dropdown-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Provides support for placing form-elements in Bootstrap dropdowns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published