File tree Expand file tree Collapse file tree
projects/igniteui-angular/src/lib/select Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -663,21 +663,18 @@ export class IgxSelectComponent extends IgxDropDownComponent implements IgxSelec
663663 }
664664 }
665665
666- for ( let index = 0 ; index < orderedTopLevelNodes . length ; index ++ ) {
666+ let nextReferenceNode : HTMLElement | null = null ;
667+ for ( let index = orderedTopLevelNodes . length - 1 ; index >= 0 ; index -- ) {
667668 const node = orderedTopLevelNodes [ index ] ;
668- if ( container . contains ( node ) ) {
669+ if ( node . parentElement === container ) {
670+ nextReferenceNode = node ;
669671 continue ;
670672 }
671- // Find the next node already in the container and insert before it
672- // to preserve template order.
673- let referenceNode : HTMLElement | null = null ;
674- for ( let nextIndex = index + 1 ; nextIndex < orderedTopLevelNodes . length ; nextIndex ++ ) {
675- if ( orderedTopLevelNodes [ nextIndex ] . parentElement === container ) {
676- referenceNode = orderedTopLevelNodes [ nextIndex ] ;
677- break ;
678- }
673+ if ( container . contains ( node ) ) {
674+ continue ;
679675 }
680- container . insertBefore ( node , referenceNode ) ;
676+ container . insertBefore ( node , nextReferenceNode ) ;
677+ nextReferenceNode = node ;
681678 }
682679 }
683680
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ <h1 class="select-sample__title">Select - disabled item</h1>
103103 </ section >
104104
105105 < section class ="select-sample__section ">
106- < h1 class ="select-sample__title "> TEST: @if/@else inside @for</ h1 >
106+ < h1 class ="select-sample__title "> Select - @if/@else inside @for</ h1 >
107107 < igx-select #nestedTest [placeholder] ="'Pick One' ">
108108 < label igxLabel > Odd/Even Select</ label >
109109 @for (item of testItems; track item; let e = $even) {
You can’t perform that action at this time.
0 commit comments