title: S-Pen forces menu list to jump back to the top
body: <p>The S-Pen does not scroll properly with a <code>MenuDropDownListView</code> after being created when pressing an <code>OverflowMenuButton</code> on the Toolbar (see gif below).</p>
  <p>The menu is forced back to the top when the S-Pen makes contact.</p>
  <p>This issue does not seem to be unique to a <code>MenuDropDownListView</code>. This also happens when scrolling a <code>PopupMenu</code> from the <code>AndroidX</code> library (<code>androidx.appcompat.widget.PopupMenu</code>). This behaviour, however, <strong>works as expected</strong> when using the standard Android library (<code>android.widget.PopupMenu</code>). <em>The PopupMenu scenario is less vital to the issue I have but it may be related nevertheless.</em></p>
  <p>The following gif is an example of attempting to scroll to the bottom of the list with an S-Pen, recorded on a Samsung Galaxy Note20 (Android 11, stock ROM):</p>
  <p><a href="https://i.stack.imgur.com/qM4hG.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qM4hG.gif" alt="Scroll OverflowMenu not working with S-Pen" /></a></p>
  <p>The following gifs are an attempt at scrolling to the bottom of each PopupMenu, recorded on Samsung Galaxy Note20 (Android 11, stock ROM):</p>
  <p><a href="https://i.stack.imgur.com/Xlty3.gif" rel="nofollow noreferrer">Android PopupMenu Scrolling Behaviour (working)</a></p>
  <p><a href="https://i.stack.imgur.com/bXGDM.gif" rel="nofollow noreferrer">AndroidX PopupMenu Scrolling Behaviour (not working)</a></p>
  <p>The code for the OverflowMenu is the following:</p>
  <p><strong>res/menu/example_menu.xml</strong></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
        xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
  &gt;
      &lt;item android:id=&quot;@+id/item1&quot;
            android:icon=&quot;@drawable/ic_5g&quot;
            android:title=&quot;Item 1&quot;
            app:showAsAction=&quot;ifRoom&quot;
      /&gt;
  
      &lt;item android:id=&quot;@+id/item2&quot;
            android:title=&quot;Item 1&quot;
            app:showAsAction=&quot;never&quot;
      /&gt;
  
      &lt;item android:id=&quot;@+id/item3&quot;
            android:title=&quot;Item 3&quot;
            app:showAsAction=&quot;never&quot;&gt;
          &lt;menu&gt;
              &lt;item android:title=&quot;TOP ITEMS HERE&quot; /&gt;
              &lt;item android:title=&quot;TOP ITEMS HERE&quot; /&gt;
              &lt;item android:title=&quot;TOP ITEMS HERE&quot; /&gt;
              &lt;item android:title=&quot;TOP ITEMS HERE&quot; /&gt;
              &lt;item android:title=&quot;TOP ITEMS HERE&quot; /&gt;
              &lt;item android:title=&quot;TOP ITEMS HERE&quot; /&gt;
              &lt;item android:title=&quot;TOP ITEMS HERE&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
              &lt;item android:title=&quot;Sub Item&quot; /&gt;
  
               &lt;!--  REPEATING...  --&gt;
  
          &lt;/menu&gt;
      &lt;/item&gt;
  
  
  &lt;/menu&gt;
  </code></pre>
  <p><strong>MainActivity.java</strong></p>
  <pre class="lang-java prettyprint-override"><code>package com.example.popupmenutest;
  
  import android.view.Menu;
  import android.view.MenuInflater;
  import androidx.appcompat.app.AppCompatActivity;
  import android.os.Bundle;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.example_menu, menu);
          return true;
      }
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  }
  </code></pre>