sukima / ember-cli-select-picker

An enhanced Boostrap styled select component addon for Ember CLI
https://sukima.github.io/ember-cli-select-picker
MIT License
23 stars 15 forks source link

Allow dropdown-menu to to respect bounds of the viewport #51

Open zbeat opened 8 years ago

zbeat commented 8 years ago

The default max-height of a dropdown-menu is 400px, as set here: https://github.com/sukima/ember-cli-select-picker/blob/master/vendor/select-picker.css#L20

This is causing menus embedded towards the bottom of a page to spill off the viewable screen. As a temporary fix in our project, we can override this max-height to 300px. But in an ideal world, wouldn't we want the library to override the default max-height IF that would cause the menu to spill off the current viewport? Thoughts?

Of note:

  1. It looks like bootstrap-select does this dynamically: https://github.com/silviomoreto/bootstrap-select/blob/a89ba9b56e6f7036afadbdf5c69718d79284c7dc/js/bootstrap-select.js#L862
  2. The Bootstrap tooltip now has a viewport option, to accommodate this (e.g. https://getbootstrap.com/javascript/#tooltips): https://github.com/twbs/bootstrap/pull/11593
sukima commented 8 years ago

This is something to fix after PR #52 gets merged.