Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
Fix baseline when direction-up positioning is used
Browse files Browse the repository at this point in the history
  • Loading branch information
cdjackson committed Aug 4, 2015
1 parent f953cc3 commit 571bb46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ body > .select2-container.open {
border-top-right-radius: 0;
}
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown {
bottom: 100%;
top: auto;
position: absolute;

border-radius: 4px; /* FIXME hardcoded value :-/ */
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
Expand Down Expand Up @@ -89,6 +93,10 @@ body > .select2-container.open {

/* Handle up direction Selectize */
.ui-select-container[theme="selectize"].direction-up .ui-select-dropdown {
bottom: 100%;
top: auto;
position: absolute;

box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);

margin-top: -2px; /* FIXME hardcoded value :-/ */
Expand Down Expand Up @@ -250,5 +258,9 @@ body > .ui-select-bootstrap.open {

/* Handle up direction Bootstrap */
.ui-select-container[theme="bootstrap"].direction-up .ui-select-dropdown {
bottom: 100%;
top: auto;
position: absolute;

box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
}
2 changes: 0 additions & 2 deletions src/uiSelectDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,6 @@ uis.directive('uiSelect',

// Determine if the direction of the dropdown needs to be changed.
if (offset.top + offset.height + offsetDropdown.height > $document[0].documentElement.scrollTop + $document[0].documentElement.clientHeight) {
dropdown[0].style.position = 'absolute';
dropdown[0].style.top = (offsetDropdown.height * -1) + 'px';
element.addClass(directionUpClassName);
}

Expand Down

0 comments on commit 571bb46

Please sign in to comment.