MenuPanel with navigationItem doesn't stay selected

I copied from your demo portal the navigation menu on the left sidebar

If I open a page directly from an url or force a refresh (f5) the menu opens in the right position, but navigating thru the pages, the expanded menu closes it self. please see the video for a better explanation

I attach the video the source of mainlayout and navitem component (1.3 MB)