@@ -971,15 +971,19 @@ export const ComboBoxMixin = (subclass) =>
971971 this . _selectItemForValue ( this . value ) ;
972972 }
973973
974- const inputValue = this . _inputElementValue ;
975- if ( inputValue === undefined || inputValue === this . _getItemLabel ( this . selectedItem ) ) {
976- // When the input element value is the same as the current value or not defined,
977- // set the focused index to the item that matches the value.
978- this . _focusedIndex = this . $ . dropdown . indexOfLabel ( this . _getItemLabel ( this . selectedItem ) ) ;
979- } else {
980- // When the user filled in something that is different from the current value = filtering is enabled,
981- // set the focused index to the item that matches the filter query.
982- this . _focusedIndex = this . $ . dropdown . indexOfLabel ( this . filter ) ;
974+ // Do not update `_focusedIndex` to from `-1` to old value during scroll.
975+ // Otherwise, the scroll would jump back to the previously focused item.
976+ if ( ! this . loading ) {
977+ const inputValue = this . _inputElementValue ;
978+ if ( inputValue === undefined || inputValue === this . _getItemLabel ( this . selectedItem ) ) {
979+ // When the input element value is the same as the current value or not defined,
980+ // set the focused index to the item that matches the value.
981+ this . _focusedIndex = this . $ . dropdown . indexOfLabel ( this . _getItemLabel ( this . selectedItem ) ) ;
982+ } else {
983+ // When the user filled in something that is different from the current value = filtering is enabled,
984+ // set the focused index to the item that matches the filter query.
985+ this . _focusedIndex = this . $ . dropdown . indexOfLabel ( this . filter ) ;
986+ }
983987 }
984988 }
985989 }
0 commit comments