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

Open page on pages with sub-links #249

Open
lottaar opened this issue May 22, 2024 · 1 comment
Open

Open page on pages with sub-links #249

lottaar opened this issue May 22, 2024 · 1 comment

Comments

@lottaar
Copy link

lottaar commented May 22, 2024

Is there any way in version 2 to open linked pages on items that have sub-links? For example by separating the text from the arrow, or clicking twice?

@vadikom
Copy link
Owner

vadikom commented May 28, 2024

Hi, yes. This is a nav item that acts just as a sub toggler (even if you set an actual URL in the href):

<li class="sm-nav-item">
  <a class="sm-nav-link sm-sub-toggler" href="#">Sub</a>
  <ul class="sm-sub">
    ...

And here is a "split" item that has a separate link part and a sub toggler part (a separate button element):

<li class="sm-nav-item">
  <a class="sm-nav-link sm-nav-link--split" href="#">Link</a>
  <button class="sm-nav-link sm-nav-link--split sm-sub-toggler" aria-label="Toggle sub menu"></button>
    <ul class="sm-sub">
      ...

The same logic is supported for sub items (you just need to use the sm-sub-item/sm-sub-link/sm-sub-link--split classes instead).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants