Skip to content

Commit

Permalink
Alignment at the bottom edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Fa-So committed Dec 12, 2017
1 parent 68ac950 commit 266fef0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,12 @@ export class List extends React.Component {
// If the select panel is very bottom, tries to adjust the position 'top' so the panel can open fully on-screen.
// If it still won't fit, sets the offset back to 0 to allow the fallback position to take over.
const innerHeight = window.innerHeight
const listHeight = LIST_ITEM_HEIGHT * Math.min(MAX_LIST_LENGTH, options.length) + PADDING_TOP
let listHeight = LIST_ITEM_HEIGHT * Math.min(MAX_LIST_LENGTH, options.length)
if (this.props.isInsideTable) {
listHeight += PADDING_TOP
} else {
listHeight -= PADDING_TOP
}
if (top < 0) {
top = 0
} else if (top + listHeight > innerHeight) {
Expand Down

0 comments on commit 266fef0

Please sign in to comment.