Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: event is undefined in js #416

Closed
1 task done
bjhijmans opened this issue Jan 26, 2022 · 1 comment
Closed
1 task done

Uncaught TypeError: event is undefined in js #416

bjhijmans opened this issue Jan 26, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@bjhijmans
Copy link
Contributor

What happened?
Whenever I click a sub-item of a menu item, I get a type error in my console that says event is not defined.

The problem occurs in theme-default.js on line 16 in the closeSidebar function. Here is the definition of the function:

function closeSidebar(event) {
        event.preventDefault();
        if (menuWrapper) {
            menuWrapper.classList.remove('open');
            navButton.classList.remove('open');
        }
    }

And the only place where it's called is on line 82:

    closeSidebar();

No parameter is passed here, so the event parameter is undefined.

My guess is you can simply remove the parameter and the event.preventDefault() call, but there might be a reason it's there that I'm not aware of?

My environment:

  • PHP version (from php -v): 8.0
  • Framework (Laravel/Lumen): Laravel
  • Laravel version 8.76.1:
  • Scribe version 3.21.0:

My Scribe config (minus the comments):

Additional info:

@bjhijmans bjhijmans added the bug Something isn't working label Jan 26, 2022
@shalvah
Copy link
Contributor

shalvah commented Jan 26, 2022

Thanks for the report. Do any other visible bugs happen when you click?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants