fix: typo in Dropdown.ts

This commit is contained in:
Daniël Klabbers 2024-12-04 21:47:02 +01:00 committed by GitHub
parent 097a54289f
commit 6d88c99782
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,12 +93,12 @@ export default class Dropdown<CustomAttrs extends IDropdownAttrs = IDropdownAttr
const top = $menu.offset()?.top ?? 0;
const height = $menu.height() ?? 0;
const windowSrollTop = $(window).scrollTop() ?? 0;
const windowScrollTop = $(window).scrollTop() ?? 0;
const windowHeight = $(window).height() ?? 0;
$menu.removeClass('Dropdown-menu--top Dropdown-menu--right');
$menu.toggleClass('Dropdown-menu--top', top + height > windowSrollTop + windowHeight);
$menu.toggleClass('Dropdown-menu--top', top + height > windowScrollTop + windowHeight);
if (($menu.offset()?.top || 0) < 0) {
$menu.removeClass('Dropdown-menu--top');