Does anyone have experience troubleshooting issues with navbars? I could really use some help.
I am facing an issue with my navigation bar where I have different links that reveal an unordered list of sublinks upon clicking.
The CSS for my <ul> is set to opacity: 0
, and in my stylesheet, I have the following code:
.tab ul {
opacity: 0;
pointer-events: none;
}
.tab a:focus + ul {
opacity: 1;
transform: translateY(0px);
pointer-events: all;
}
(this section of the code seems to be causing the problem)
When I click on a link, the tab does expand, and the pointer events are set to `all` (I can tell because the color of the sublinks changes when hovered over). The problem arises when I click on a sublink - the focus on the original tab link is lost and it appears that the `pointer-events` property is set to `none` BEFORE executing the action of the sublink (a simple href="page.html").
I attempted removing the `:focus` pseudo-class to keep the tab constantly in focus, which allowed the sublinks to redirect me to the intended pages.
Additionally, I tried applying `pointer-events: all` to ul > li > a, but this did not solve the issue.
From my observations, it seems like the tab link loses focus and the pointer event is disabled before the sublink's action is triggered.
Does anyone know of a workaround to ensure the sublink's action is executed before losing focus?
In the unfolded tab with a hovered sublink (mouse cursor not visible in the screenshot):