Skip to content

Commit

Permalink
fix: use Header Menu width (instead of minWidth) to align right (#624)
Browse files Browse the repository at this point in the history
- when the header menu is aligned to the right (instead of default to left), the menu was a bit offset because we were using the wrong width
  • Loading branch information
ghiscoding authored Aug 27, 2021
1 parent e6455c1 commit beef51f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/slick.headermenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@
// to simulate an align left, we actually need to know the width of the drop menu
if (options.autoAlign) {
var gridPos = _grid.getGridPosition();
if ((leftPos + options.minWidth) >= gridPos.width) {
leftPos = leftPos - options.minWidth + options.autoAlignOffset;
if ((leftPos + $menu.width()) >= gridPos.width) {
leftPos = leftPos + $menuButton.outerWidth() - $menu.outerWidth() + options.autoAlignOffset;
}
}

Expand Down

0 comments on commit beef51f

Please sign in to comment.