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

Fix baseline when direction-up positioning is used #1123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
4 changes: 0 additions & 4 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 All @@ -288,8 +286,6 @@ uis.directive('uiSelect',
}

// Reset the position of the dropdown.
dropdown[0].style.position = '';
dropdown[0].style.top = '';
element.removeClass(directionUpClassName);
}
});
Expand Down