Multiple anchor ids in a page result in all corresponding subnav elements set to "active"

Hi folks,

I hope this isn’t the wrong place to ask this, but I am using roots as a starter for a custom theme I am building and I hope you can point me in the right direction. I have created the site map in WordpPress for the site and some of the subnav elements are anchor tags within the top level pages. If I click on any of the subnav elements, all of the subnav elements become active and it makes the menu hard to use.
Is there a way to make the navbar and subnav recognize that the anchor is within the page and show only the anchor element that has been clicked as the active state?

Thank you.