diff --git a/lib/Autocomplete.js b/lib/Autocomplete.js index 6f7efaa5..8b6da598 100644 --- a/lib/Autocomplete.js +++ b/lib/Autocomplete.js @@ -30,9 +30,9 @@ let Autocomplete = React.createClass({ background: 'rgba(255, 255, 255, 0.9)', padding: '2px 0', fontSize: '90%', - position: 'fixed', + position: 'absolute', overflow: 'auto', - maxHeight: '50%', // TODO: don't cheat, let it flow to the bottom + maxHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0)/2 +'px', } } }, @@ -217,12 +217,9 @@ let Autocomplete = React.createClass({ var node = this.refs.input var rect = node.getBoundingClientRect() var computedStyle = getComputedStyle(node) - var marginBottom = parseInt(computedStyle.marginBottom, 10) var marginLeft = parseInt(computedStyle.marginLeft, 10) var marginRight = parseInt(computedStyle.marginRight, 10) this.setState({ - menuTop: rect.bottom + marginBottom, - menuLeft: rect.left + marginLeft, menuWidth: rect.width + marginLeft + marginRight }) }, @@ -298,7 +295,7 @@ let Autocomplete = React.createClass({ }) } return ( -
+