iron-menu-behavior icon indicating copy to clipboard operation
iron-menu-behavior copied to clipboard

Menu scrolls unexpectedly when selecting next/previous item

Open mgiuffrida opened this issue 9 years ago • 2 comments

Fiddle: https://jsfiddle.net/ntw6trbk/

  1. Focus any one of the 3 menus (tap "Item 0" or tap the dropdown trigger).
  2. Press the down arrow 5 or so times.

Expected

Once the selection is at the bottom of the visible menu container, Down should scroll the menu down by one, so the selection is always at the bottom. (select)

Actual

Every 5 or so element, the menu scroll position jumps so the selected item is in the middle of the visible menu container instead of the bottom. (paper-menu, paper-listbox)

This is particularly disorienting when the list wraps, because it's not immediately obvious that it isn't just continuing the "move downward, scroll upward" behavior.

Also repros with the down arrow (selection should always be at the top, but the menu scrolls up occasionally).

mgiuffrida avatar Jun 12 '16 14:06 mgiuffrida

It seems like this is a result of the default focus behavior: http://output.jsbin.com/duzipo

bicknellr avatar Jun 13 '16 18:06 bicknellr

scrollIntoView seems like it would help here. The general lack of scrollIntoViewOptions support is lame though.

bicknellr avatar Jun 13 '16 23:06 bicknellr