Skip to content

Commit

Permalink
switched to box-sizing border-box and removed the expected 1px border…
Browse files Browse the repository at this point in the history
… from the width calculation in javascript
  • Loading branch information
swey committed Jul 27, 2016
1 parent 3b49827 commit 69d2f1a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion content/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; margin: 0; padding: 0; }
.container { width: 800px; margin: 0 auto; }

.autocomplete-suggestions { border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
.autocomplete-suggestions { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
.autocomplete-no-suggestion { padding: 2px 5px;}
.autocomplete-selected { background: #F0F0F0; }
Expand Down
3 changes: 1 addition & 2 deletions dist/jquery.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,8 @@
}
}

// -2px to account for suggestions border.
if (that.options.width === 'auto') {
styles.width = (that.el.outerWidth() - 2) + 'px';
styles.width = that.el.outerWidth() + 'px';
}

$container.css(styles);
Expand Down
Loading

0 comments on commit 69d2f1a

Please sign in to comment.