Auto-collapse on nav item

Hello,

Is there a way to auto collapse a nav item?

image

I added an id of ‘role’ on one of the nav items, and in main on init I call

component.getNavigation().setCollapsed({id:'role'});

This doesn’t seem to collapse the item though

Am I missing something?

Thanks,

Alex