File tree Expand file tree Collapse file tree
projects/igniteui-angular/select/src/select Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -624,21 +624,18 @@ export class IgxSelectComponent extends IgxDropDownComponent implements IgxSelec
624624 }
625625 }
626626
627- for ( let index = 0 ; index < orderedTopLevelNodes . length ; index ++ ) {
627+ let nextReferenceNode : HTMLElement | null = null ;
628+ for ( let index = orderedTopLevelNodes . length - 1 ; index >= 0 ; index -- ) {
628629 const node = orderedTopLevelNodes [ index ] ;
629- if ( container . contains ( node ) ) {
630+ if ( node . parentElement === container ) {
631+ nextReferenceNode = node ;
630632 continue ;
631633 }
632- // Find the next node already in the container and insert before it
633- // to preserve template order.
634- let referenceNode : HTMLElement | null = null ;
635- for ( let nextIndex = index + 1 ; nextIndex < orderedTopLevelNodes . length ; nextIndex ++ ) {
636- if ( orderedTopLevelNodes [ nextIndex ] . parentElement === container ) {
637- referenceNode = orderedTopLevelNodes [ nextIndex ] ;
638- break ;
639- }
634+ if ( container . contains ( node ) ) {
635+ continue ;
640636 }
641- container . insertBefore ( node , referenceNode ) ;
637+ container . insertBefore ( node , nextReferenceNode ) ;
638+ nextReferenceNode = node ;
642639 }
643640 }
644641
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