• Priority: 0
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 12.01.22, 11:44
  • Opened by: Stefano
  • Closed by: Anonymous Submitter
  • Closed on:
  • Reason: Not a bug

Ticket #22888 - Disable 1st level menu link for items with submenu

Hi,
I need to disable the link for the first level menu items with submenu.

For example, I want to prevent the current page from being reloaded by clicking on the “Prodotti” item in the menu (screenshot 01).

I tried to leave blank the “link” field in the Promokit menu module, then to put “#” (screenshot 2) but it doesn’t work.

Attachments:

screenshot-01.jpg (194 KiB)
screenshot-02.jpg (62.3 KiB)

Comments

Fred 12 Jan 2022, 18:24

Hi, Stefano.
Try following CSS fix

.level-1.parent {
  pointer-events:none
}
Stefano 13 Jan 2022, 10:05

I’m sorry but it doesn’t work.
Applying this fix no longer opens the submenu.
check here: https://packaging.bwlab.it/index.php

I really can’t understand why this doesn’t happen in your demos…

Fred 13 Jan 2022, 14:11

sorry, my bad.
try this

.level-1.parent > a {
  pointer-events:none
}
Stefano 13 Jan 2022, 14:42

I already tried this fix.
Using it stop the submenu to open in mobile version (screenshot 1).
Using “pointer-events:none” can’t work in my opinion because both the “item name” span and the “down arrow” span are contained in the same link (screenshot 2).

Attachments:

screenshot-01.jpg (59.4 KiB)
screenshot-2.jpg (105.6 KiB)
Fred 14 Jan 2022, 12:10

Ok, but you can apply it for big screens only

@media(min-width:1024px) {
  .level-1.parent > a {
    pointer-events:none
  }
}
Stefano 14 Jan 2022, 12:21

Sure, I can do it, but in that way in mobile version the page will reload if i tap on the menu item name, and it shouldn’t.

Fred 15 Jan 2022, 12:05

Ok, another try but using JS - https://take.ms/nuVFi

Stefano 17 Jan 2022, 16:25

This fix works perfectly, thanks!
Yu can close the ticket.

Fred 17 Jan 2022, 16:27

You are welcome!