templaza / astroid-framework

Powerful framework for designers and developers to create responsive, fast & robust Joomla based websites and templates.
https://astroidframe.work/
GNU General Public License v3.0
83 stars 13 forks source link

how to prevent clicks on separator links #534

Closed web54 closed 7 months ago

web54 commented 8 months ago

On the astroid template, when a separator-type menu link is created, the visitor can click on it and this takes them back to the home page. This should not be the correct behaviour. clic on separator should be disabled and impossible to do

Giorgi625 commented 8 months ago

It has class "item-link-separator' so you can add custom css to disable it. I somehow did it on on my old website I will check what solution I used there.

Turned out I just added class disabled to menu item and it disables link in that menu item image

web54 commented 8 months ago

That is not enough, I added this class , and still clickable. I suppose you add some custom css ?

web54 commented 8 months ago

.disabled{ pointer-events: none; cursor: default; }

Giorgi625 commented 8 months ago

No I have not added anything else just this class to menu item which. I guess its Bootstrap feature. This is what I See in console

.nav-link.disabled, .nav-link:disabled { color: var(--bs-nav-link-disabled-color); pointer-events: none; cursor: default; }

web54 commented 8 months ago

so it can be : .item-link-separator { pointer-events: none; cursor: default; }

Giorgi625 commented 8 months ago

In Screenshot I took above I added that that class to new website on J5 with latest Astroid One template so I do not get why it did not disabled link in your menu item.

web54 commented 8 months ago

No I have not added anything else just this class to menu item which. I guess its Bootstrap feature. This is what I See in console

.nav-link.disabled, .nav-link:disabled { color: var(--bs-nav-link-disabled-color); pointer-events: none; cursor: default; }

So that is what I found and have done, I guess bootstrap is not loaded on this site. So I suggest to add this css in astroid files : .item-link-separator { pointer-events: none; cursor: default; }

Chacapamac commented 8 months ago

I just test a Joomla Menu item type “Separator” Joomla 4.4.2 — PHP — 8.1.13 Astroid One 3.0.8

• “Separator” without the class “disabled” — You can click on the link, and it bring you to the “Home” Page (Home Page URL) — You have an .hover effect on the link and it bring the sub-menus — Work Well on Mobile Menu

• “Separator” with the class “disabled” — You cannot click on the link (Got same Home Page URL, but disabled) — No .hover effect on the link and it bring the sub-menus — Work Well on Mobile Menu

sonvnn commented 8 months ago

@Chacapamac @web54 I fixed this issue in https://github.com/templaza/astroid-framework/commit/c13db8cbac64ba5e449cdad4e88849d77c77fc17

Please help me download v3-branch and test it.

Thanks & Best Regards, Sonny

web54 commented 8 months ago

@Chacapamac @web54 I fixed this issue in c13db8c

Please help me download v3-branch and test it.

Thanks & Best Regards, Sonny

Tested So

sonvnn commented 8 months ago

@web54 I fixed issue in v3.0.9. Please help me check it again.

web54 commented 8 months ago

that is what I have done and commented : it works, no link, but still a hand on hover so people can believe it is possible to click

watch it on my dev link ; https://www.cigale-evasion.weblor.fr/astroid3/ link is "test separator" for exemple

sonvnn commented 8 months ago

@web54 please clear Astroid cache and Browser cache. Refresh again!

web54 commented 8 months ago

ok that's good now, it was the cache thanks for all