File tree Expand file tree Collapse file tree 2 files changed +1
-9
lines changed
Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,6 @@ export default class XPgMenuBasic extends HTMLElement {
2424 }
2525
2626 #handleSelect( e : any ) {
27- this . $menu . items . forEach ( item => {
28- if ( item . checked && item . index !== e . detail . index ) {
29- item . checked = false ;
30- }
31- if ( ! item . checked && item . index === e . detail . index ) {
32- item . checked = true ;
33- }
34- } )
3527 // update clicked result
3628 this . $result . textContent = JSON . stringify ( e . detail ) ;
3729 }
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default class PgMenu extends HTMLElement {
3333 detail : { index, item }
3434 } ) ) ;
3535 if ( this . previousIndex !== - 1 ) {
36- this . items [ this . previousIndex ] . checked = false ;
36+ ( this . $ items. children [ this . previousIndex ] as PgMenuItem ) . checked = false ;
3737 }
3838 $item . checked = true ;
3939 this . previousIndex = index ;
You can’t perform that action at this time.
0 commit comments