title: Bottom navigation bar malfunctions when navigating from a fragment
body: <p>I'm using the bottom navigation bar with the navigation component</p>
  <p>To make the two components work together I called:</p>
  <pre><code>bottomNavigationView.setupWithNavController(navController)
  </code></pre>
  <p>Everything works as expected except when I navigate from inside a fragment instead of the bottom navigation bar</p>
  <p><a href="https://i.stack.imgur.com/narAS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/narAS.jpg" alt="enter image description here" /></a></p>
  <p>&quot;View all&quot; opens the same fragment as &quot;Reports&quot; from the bottom navigation bar</p>
  <pre><code>binding.viewAllScansTv.setOnClickListener {
      val action = MainFragmentDirections.actionMainFragmentToReportsFragment()
      navController.navigate(action)
  }
  </code></pre>
  <p>After clicking on &quot;View all&quot;, the fragment is opened, the &quot;Reports&quot; button gets selected, however, <strong>navigating back &quot;Home&quot; does not work anymore</strong></p>
  <p><strong>How can I fix this weird behavior?</strong></p>
  <p>The nav graph:</p>
  <pre><code>&lt;navigation app:startDestination=&quot;@id/mainFragment&quot;&gt;
      &lt;fragment
          android:id=&quot;@+id/mainFragment&quot;
          android:name=&quot;com.package.name.ui.main.MainFragment&quot;
          android:label=&quot;MainFragment&quot;&gt; 
          &lt;action                android:id=&quot;@+id/action_mainFragment_to_reportsFragment&quot;
              app:destination=&quot;@id/reportsFragment&quot; /&gt;
      &lt;/fragment&gt;
  &lt;/navigation&gt;
  </code></pre>
  <p>The bottom navigation menu:</p>
  <pre><code>&lt;menu&gt;
      &lt;item
          android:id=&quot;@+id/mainFragment&quot;
          android:title=&quot;Home&quot;/&gt;    
      &lt;item
          android:id=&quot;@+id/reportsFragment&quot;
          android:title=&quot;Reports&quot;/&gt;
      &lt;item
          android:id=&quot;@+id/settingsFragment&quot;
          android:title=&quot;My account&quot;/&gt;
  &lt;/menu&gt;
  </code></pre>