WAIT: Nav menu js error

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

Hello, on console, there is an error that is nav menu related.

In this part of code
jQuery(document).ready(function($) {
function adjustSubmenuPosition() {
var $popup = $(‘.popup’);
var popupTop = $popup.offset().top;
var popupHeight = $popup.outerHeight();

    $('.popup .sub-menu').each(function() {
        var $submenu = $(this);
        var $parent = $submenu.parent().closest('.sub-menu, .popup > .inner > .sub-menu');
        var parentHeight = $parent.outerHeight();
        var $parentLi = $submenu.parent();
        var parentOffset = $parentLi.offset();
        var windowWidth = $(window).width();
        var submenuWidth = $submenu.outerWidth();

        // Set minimum height to parent's height
        $submenu.css({
            minHeight: parentHeight,
            top: popupTop - parentOffset.top
        });

        if (parentOffset.left + $parentLi.outerWidth() + submenuWidth > windowWidth) {
            $submenu.css({
                left: 'auto',
                right: '100%'
            });
        } else {
            $submenu.css({
                left: '100%',
                right: 'auto'
            });
        }
    });
}

On this line: var popupTop = $popup.offset().top;

I get this
Uncaught TypeError: Cannot read properties of undefined (reading ‘top’)
at adjustSubmenuPosition (VM947 air-condition:4:39)
at dispatch (jquery.min.js?ver=3.7.1:2:40035)
at v.handle (jquery.min.js?ver=3.7.1:2:38006)

The header has sticky enabled.

I use bricks builder 2.3.8

Site url:

It’s because you don’t have .popup on your site so $popup.offset() is returning undefined.
If you are using Bricks templates to create the popup, make sure to add the condition to render the popup.

Hi @konlal,

Looks like this code is not coming from Bricks itself. Can you try disabling all custom code and plugins and you should see the error disappear.

Let me know,
Matej