Skip to content

Commit 88f1f99

Browse files
committed
fixed issue if user resized multiple times items are moved back without the whitespace character between items so the children width would be equal than container width.
1 parent b27cd73 commit 88f1f99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/priority-nav.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
/**
292292
* Keep executing until all menu items that are overflowing are moved
293293
*/
294-
while (totalWidth < restWidth && _this.querySelector(mainNav).children.length > 0 || viewportWidth < settings.breakPoint && _this.querySelector(mainNav).children.length > 0) {
294+
while (totalWidth <= restWidth && _this.querySelector(mainNav).children.length > 0 || viewportWidth < settings.breakPoint && _this.querySelector(mainNav).children.length > 0) {
295295
//move item to dropdown
296296
priorityNav.toDropdown(_this, identifier);
297297
//recalculate widths
@@ -303,7 +303,7 @@
303303
/**
304304
* Keep executing until all menu items that are able to move back are moved
305305
*/
306-
while (totalWidth > breaks[identifier][breaks[identifier].length - 1] && viewportWidth > settings.breakPoint) {
306+
while (totalWidth >= breaks[identifier][breaks[identifier].length - 1] && viewportWidth > settings.breakPoint) {
307307
//move item to menu
308308
priorityNav.toMenu(_this, identifier);
309309
//update dropdownToggle label

0 commit comments

Comments
 (0)