Fix issue where navigation element did not close