Skip to content

Commit 3d54802

Browse files
committed
Fix baseline when direction-up positioning is used
angular-ui#973
1 parent f953cc3 commit 3d54802

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/common.css

+12
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ body > .select2-container.open {
4747
border-top-right-radius: 0;
4848
}
4949
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown {
50+
bottom: 100%;
51+
top: auto;
52+
position: absolute;
53+
5054
border-radius: 4px; /* FIXME hardcoded value :-/ */
5155
border-bottom-left-radius: 0;
5256
border-bottom-right-radius: 0;
@@ -89,6 +93,10 @@ body > .select2-container.open {
8993

9094
/* Handle up direction Selectize */
9195
.ui-select-container[theme="selectize"].direction-up .ui-select-dropdown {
96+
bottom: 100%;
97+
top: auto;
98+
position: absolute;
99+
92100
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
93101

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

251259
/* Handle up direction Bootstrap */
252260
.ui-select-container[theme="bootstrap"].direction-up .ui-select-dropdown {
261+
bottom: 100%;
262+
top: auto;
263+
position: absolute;
264+
253265
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
254266
}

src/uiSelectDirective.js

-4
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ uis.directive('uiSelect',
274274

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

@@ -288,8 +286,6 @@ uis.directive('uiSelect',
288286
}
289287

290288
// Reset the position of the dropdown.
291-
dropdown[0].style.position = '';
292-
dropdown[0].style.top = '';
293289
element.removeClass(directionUpClassName);
294290
}
295291
});

0 commit comments

Comments
 (0)