11import { html , render , nothing , TemplateResult , PropertyValues } from 'lit' ;
2- import {
3- eventOptions ,
4- property ,
5- queryAssignedElements ,
6- state ,
7- } from 'lit/decorators.js' ;
2+ import { property , queryAssignedElements , state } from 'lit/decorators.js' ;
83import { classMap } from 'lit/directives/class-map.js' ;
94import { ifDefined } from 'lit/directives/if-defined.js' ;
105import { repeat } from 'lit/directives/repeat.js' ;
@@ -411,10 +406,9 @@ export class VscodeSelectBase extends VscElement {
411406 }
412407 }
413408
414- @eventOptions ( { passive : true } )
415- protected _onOptionListScroll ( ev : Event ) {
416- this . _optionListScrollPos = ( ev . target as HTMLUListElement ) . scrollTop ;
417- }
409+ private _onOptionListScroll = ( ev : CustomEvent < number > ) => {
410+ this . _optionListScrollPos = ev . detail ;
411+ } ;
418412
419413 protected _onOptionMouseOver ( ev : MouseEvent ) : void {
420414 if ( this . _isHoverForbidden ) {
@@ -749,8 +743,8 @@ export class VscodeSelectBase extends VscElement {
749743 } ;
750744
751745 const scrollPaneHeight = Math . min (
752- this . _opts . numOfVisibleOptions * OPT_HEIGHT + 2 ,
753- VISIBLE_OPTS * OPT_HEIGHT + 2
746+ this . _opts . numOfVisibleOptions * OPT_HEIGHT ,
747+ VISIBLE_OPTS * OPT_HEIGHT
754748 ) ;
755749
756750 return html `
@@ -760,7 +754,7 @@ export class VscodeSelectBase extends VscElement {
760754 always-visible
761755 class ="scrollable "
762756 tabindex ="-1 "
763- @scroll =${ this . _onOptionListScroll }
757+ @vsc-scrollable-change =${ this . _onOptionListScroll }
764758 .scrollPos =${ this . _optionListScrollPos }
765759 .style=${ stylePropertyMap ( { height : `${ scrollPaneHeight } px` } ) }
766760 >
0 commit comments