Topic: Navigation pills stop switching after adding a modal

novaStack free asked 4 weeks ago


My page combines navigation pills with a dialog trigger. Adding the dialog makes the pill links stop switching panels.

Could script placement affect initialization order?


Igor Przybysz staff answered 4 weeks ago


Yes, initialization order is worth checking here. For a plain HTML page using the UMD bundle, load that bundle once after the navigation and modal markup, before the closing body tag. A deferred script is another option when the entire markup is present during initial parsing. Check the first console error, since an earlier exception may interrupt setup.

Then verify that every pill targets a unique panel ID and that the modal has not introduced duplicate IDs or invalid nesting. If the issue remains, please share a minimal page containing just two pills, their panels, the modal, and the script tags.

https://mdbootstrap.com/docs/standard/navigation/pills/


novaStack free commented 4 weeks ago

The bundle was loaded in the head without defer. I moved it below the modal and tab panels and removed a duplicate script include from the shared partial. Both pills switch correctly now, and the dialog still opens. That was the missing piece, thank you.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 9.3.0
  • Device: Desktop
  • Browser: Edge
  • OS: macOS
  • Provided sample code: No
  • Provided link: No