@@ -29,7 +29,7 @@ import { IgxTreeNodeComponent } from './tree-node/tree-node.component';
2929import { IgxTreeSelectionService } from './tree-selection.service' ;
3030import { IgxTreeService } from './tree.service' ;
3131import { growVerIn , growVerOut } from 'igniteui-angular/animations' ;
32- import { resizeObservable } from '../core/utils' ;
32+ import { PlatformUtil , resizeObservable } from '../core/utils' ;
3333
3434/**
3535 * @hidden @internal
@@ -327,6 +327,7 @@ export class IgxTreeComponent implements IgxTree, OnInit, AfterViewInit, OnDestr
327327 private selectionService : IgxTreeSelectionService ,
328328 private treeService : IgxTreeService ,
329329 private element : ElementRef < HTMLElement > ,
330+ private platform : PlatformUtil ,
330331 ) {
331332 this . selectionService . register ( this ) ;
332333 this . treeService . register ( this ) ;
@@ -501,14 +502,15 @@ export class IgxTreeComponent implements IgxTree, OnInit, AfterViewInit, OnDestr
501502 private subToChanges ( ) {
502503 this . unsubChildren$ . next ( ) ;
503504 const toBeSelected = [ ...this . forceSelect ] ;
504- requestAnimationFrame ( ( ) => {
505- this . selectionService . selectNodesWithNoEvent ( toBeSelected ) ;
506- } ) ;
505+
507506 if ( this . platform . isBrowser ) {
508507 requestAnimationFrame ( ( ) => {
509508 this . selectionService . selectNodesWithNoEvent ( toBeSelected ) ;
510509 } ) ;
510+ } else {
511+ this . selectionService . selectNodesWithNoEvent ( toBeSelected ) ;
511512 }
513+
512514 this . forceSelect = [ ] ;
513515 this . nodes . forEach ( node => {
514516 node . expandedChange . pipe ( takeUntil ( this . unsubChildren$ ) ) . subscribe ( nodeState => {
0 commit comments