-
Notifications
You must be signed in to change notification settings - Fork 234
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
Cannot activate link #247
Comments
I wonder if this is related to #246 perhaps the active class is conflicting. I'll need to look into it. |
I don't use active class in any other case. Only it be in generated menu. |
excuse me my english ... There is a this situation. User classes remove the active class. |
Yes, sounds like there might be a bug with the active class overwriting the classes. If you have control over the CSS you might avoid adding classes to the link, and instead use |
I've ran into this today and took a look. The problem is that the 'active' class is set to the link as soon as the Item is created and when the Link->attr() is used, if the 'class' key is set, the active class is overridden by the classes that are set in the array by the array_merge. (Link.php:102). My code fix is below, I've rearranged the if a bit to add the fix, feel free to use it if you wish.
Just a quick explanation about the fix (I'm sure you're able to figure it out but it doesn't hurt to explain), it checks if the link is active, has the key class set and if that key doesn't have the active_class string in the, if this conditions apply, it adds the active class to the key. |
This fixed the issue, haven't you submitted the pull request? Or there's another way to fix the issue than modifying directly the vendor folder? |
Hi!
I tried this module but it didn't set "active" class in code:
If I comment one line it's work:
Maybe I do something wrong?
Thank you!
The text was updated successfully, but these errors were encountered: