Skip to content

Commit 0068bf0

Browse files
author
Tomas Kirda
authored
Merge pull request #520 from swey/pr
switched to box-sizing border-box and removed the expected 1px border…
2 parents 3b49827 + b42125f commit 0068bf0

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

content/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; margin: 0; padding: 0; }
22
.container { width: 800px; margin: 0 auto; }
33

4-
.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); }
4+
.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); }
55
.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
66
.autocomplete-no-suggestion { padding: 2px 5px;}
77
.autocomplete-selected { background: #F0F0F0; }

dist/jquery.autocomplete.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176

177177
// Only set width if it was provided:
178178
if (options.width !== 'auto') {
179-
container.width(options.width);
179+
container.css('width', options.width);
180180
}
181181

182182
// Listen for mouse over event on suggestions list:
@@ -332,9 +332,8 @@
332332
}
333333
}
334334

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

340339
$container.css(styles);
@@ -736,8 +735,8 @@
736735
// Also it adjusts if input width has changed.
737736
// -2px to account for suggestions border.
738737
if (options.width === 'auto') {
739-
width = that.el.outerWidth() - 2;
740-
container.width(width > 0 ? width : 300);
738+
width = that.el.outerWidth();
739+
container.css('width', width > 0 ? width : 300);
741740
}
742741
},
743742

0 commit comments

Comments
 (0)