File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/multiple-select-vanilla/src Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ export class MultipleSelectInstance {
40
40
protected okButtonElm ?: HTMLButtonElement ;
41
41
protected filterParentElm ?: HTMLDivElement | null ;
42
42
protected lastFocusedItemKey = '' ;
43
+ protected lastMouseOverPosition = '' ;
43
44
protected ulElm ?: HTMLUListElement | null ;
44
45
protected parentElm ! : HTMLDivElement ;
45
46
protected labelElm ?: HTMLLabelElement | null ;
@@ -1002,7 +1003,8 @@ export class MultipleSelectInstance {
1002
1003
'mouseover' ,
1003
1004
( ( e : MouseEvent & { target : HTMLDivElement | HTMLLIElement } ) => {
1004
1005
const liElm = ( e . target . closest ( '.ms-select-all' ) || e . target . closest ( 'li' ) ) as HTMLLIElement ;
1005
- if ( this . dropElm . contains ( liElm ) && this . scrolledByMouse ) {
1006
+
1007
+ if ( this . dropElm . contains ( liElm ) && this . lastMouseOverPosition !== `${ e . clientX } :${ e . clientY } ` ) {
1006
1008
const optionElms = this . dropElm ?. querySelectorAll < HTMLLIElement > ( OPTIONS_LIST_SELECTOR ) || [ ] ;
1007
1009
const newIdx = Array . from ( optionElms ) . findIndex ( el => el . dataset . key === liElm . dataset . key ) ;
1008
1010
if ( this . _currentHighlightIndex !== newIdx && ! liElm . classList . contains ( 'disabled' ) ) {
@@ -1011,6 +1013,7 @@ export class MultipleSelectInstance {
1011
1013
this . changeCurrentOptionHighlight ( liElm ) ;
1012
1014
}
1013
1015
}
1016
+ this . lastMouseOverPosition = `${ e . clientX } :${ e . clientY } ` ;
1014
1017
} ) as EventListener ,
1015
1018
undefined ,
1016
1019
'hover-highlight' ,
You can’t perform that action at this time.
0 commit comments