diff --git a/lib/Autocomplete.js b/lib/Autocomplete.js index af2fe1aa..d336ec72 100644 --- a/lib/Autocomplete.js +++ b/lib/Autocomplete.js @@ -220,9 +220,9 @@ let Autocomplete = React.createClass({ var node = this.refs.input var rect = node.getBoundingClientRect() var computedStyle = global.window.getComputedStyle(node) - var marginBottom = parseInt(computedStyle.marginBottom, 10) - var marginLeft = parseInt(computedStyle.marginLeft, 10) - var marginRight = parseInt(computedStyle.marginRight, 10) + var marginBottom = parseInt(computedStyle.marginBottom, 10) || 0; + var marginLeft = parseInt(computedStyle.marginLeft, 10) || 0; + var marginRight = parseInt(computedStyle.marginRight, 10) || 0; this.setState({ menuTop: rect.bottom + marginBottom, menuLeft: rect.left + marginLeft,