Topic: Programmatically close sideNav leaves card.active class on simple link clicks
elemech premium asked 4 years ago
Hello. I have followed the best answer to this question, but when you click on a simple link, it leaves the card.active
class on it until you click it again. How can I fix this?
elemech premium answered 4 years ago
I found the issue. Thank you for your help @Konrad Stępień. Apparently, if you have a simple link without the mdb-accordion-item-body
tag (even if empty), this bug will occur. My fixed code:
<mdb-accordion-item class="no-collase">
<mdb-accordion-item-head mdbWavesEffect routerLink="/about" (click)="closeSideNav()">
<fa-icon [icon]="faInfo" class="mr-2"></fa-icon> About Us
</mdb-accordion-item-head>
<mdb-accordion-item-body></mdb-accordion-item-body> <!-- YOU NEED THIS -->
</mdb-accordion-item>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Premium
- Premium support: Yes
- Technology: MDB Angular
- MDB Version: 9.0.1
- Device: Desktop
- Browser: Chrome
- OS: Windows 10
- Provided sample code: Yes
- Provided link: Yes
Konrad Stępień staff commented 4 years ago
Hi @elemech,
Could you send me part of your code?
elemech premium commented 4 years ago
@Konrad Stępień hello Konrad. I am using the exact same code from the linked answer in my question.
Konrad Stępień staff commented 4 years ago
@elemech I don't have an issue like yours. Could you test my code?
and ts