+ this.menu.style.width = `${menuOriginalRect.width}px`;
+ heightOffset = dropUpwards ? (window.innerHeight - menuOriginalRect.top - toggleHeight / 2) : menuOriginalRect.top;
+ }
+
+ // Adjust menu to display upwards if near the bottom of the screen
+ if (dropUpwards) {
+ this.menu.style.top = 'initial';
+ this.menu.style.bottom = `${heightOffset}px`;
+ } else {
+ this.menu.style.top = `${heightOffset}px`;
+ this.menu.style.bottom = 'initial';