@@ -20,8 +20,8 @@ import {
2020import { VscElement } from '../VscElement.js' ;
2121import { chevronDownIcon } from './template-elements.js' ;
2222
23- const VISIBLE_OPTS = 10 ;
24- const OPT_HEIGHT = 22 ;
23+ export const VISIBLE_OPTS = 10 ;
24+ export const OPT_HEIGHT = 22 ;
2525
2626/**
2727 * @cssprop --dropdown-z-index - workaround for dropdown z-index issues
@@ -232,7 +232,7 @@ export class VscodeSelectBase extends VscElement {
232232 private _isBeingFiltered = false ;
233233
234234 @state ( )
235- private _optionListScrollPos = 0 ;
235+ protected _optionListScrollPos = 0 ;
236236
237237 /** @internal */
238238 protected _multiple = false ;
@@ -308,28 +308,12 @@ export class VscodeSelectBase extends VscElement {
308308 this . _value = values [ 0 ] ;
309309 this . _values = values ;
310310 }
311-
312- if ( ! this . _multiple && ! this . combobox && selectedIndexes . length === 0 ) {
313- this . _selectedIndex = this . _options . length > 0 ? 0 : - 1 ;
314- }
315311 }
316312
317313 protected _toggleDropdown ( visible : boolean ) {
318314 this . open = visible ;
319315 this . ariaExpanded = String ( visible ) ;
320316
321- if ( visible && ! this . _multiple ) {
322- this . _activeIndex = this . _selectedIndex ;
323- }
324-
325- if ( visible && ! this . _multiple && ! this . combobox ) {
326- this . _activeIndex = this . _selectedIndex ;
327-
328- if ( this . _activeIndex > VISIBLE_OPTS - 1 ) {
329- this . _optionListScrollPos = Math . floor ( this . _activeIndex * OPT_HEIGHT ) ;
330- }
331- }
332-
333317 if ( visible ) {
334318 window . addEventListener ( 'click' , this . _onClickOutside ) ;
335319 } else {
@@ -505,7 +489,7 @@ export class VscodeSelectBase extends VscElement {
505489 }
506490 }
507491
508- private _scrollActiveElementToTop ( ) {
492+ protected _scrollActiveElementToTop ( ) {
509493 this . _optionListScrollPos = Math . floor ( this . _activeIndex * OPT_HEIGHT ) ;
510494 }
511495
0 commit comments