ejs-dropdowntree setting value before dataSource is available does not work

As subject states, when I have a ejs-dropdowntree with a value assigned to it, like ["1"]. That is supposed to pre-select the first entry after data is bound. However when my data gets bound the first entry never gets selected.

Not sure if it matters but I set my value through a reactive form, as my ejs-dropdowntree is a formControl. So you can reproduce this simply by:

Assume that data has nodeIds: 1, 2, 3, 4, 5, etc.

My package is on the latest version (updated and tested on 4/17/26)


HTML:

<ejs-dropdowntree [fields]='fields' formControlName="myControl"></ejs-dropdowntree>


TS:

public fields;


ngOnInit() {

  this.formGroup.get("myControl").setValue(["1"]);

  this.getData().subscribe({

    next: (data) => {

      this.fields = { dataSource: data, value: 'nodeId', text: 'nodeText', child: 'nodeChild' }

    }

  });

}


8 Replies 1 reply marked as answer

PS Praveen Sellappan Syncfusion Team April 20, 2026 05:40 PM UTC

Hi Dimitrije,


Greetings from Syncfusion Support.


Based on the information provided, we have validated and classified the reported scenarios as a bug on our end. The fix for this issue will be included in the upcoming weekly release scheduled for May 5,2026. You can track the status of the fix at the following link:


DropDownTree: Node fails to select when value property is set before dataSource assignment in Angular | Feedback Portal


Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.


Regards,

Praveen Sellappan



DP Dimitrije Prosevski replied to Praveen Sellappan April 20, 2026 07:38 PM UTC

Awesome thank you!



OC Omar Cooley April 25, 2026 06:57 AM UTC

I totally relate to the struggle of setting values before the datasource is ready! I faced a similar issue while using dropdowns in another project. A little delay with async data can really mess up your bindings. I ended up creating a fallback mechanism that waits for data availability, which made things smoother! Hope you find a good solution!




PS Praveen Sellappan Syncfusion Team April 27, 2026 02:30 PM UTC

Hi Omar,

Thank you for sharing your experience and suggestion. We appreciate your input. 

Regards,
Praveen Sellappan




PS Praveen Sellappan Syncfusion Team May 6, 2026 12:35 AM UTC

Hi Dimitrije,


We regret to inform you that we were unable to include the fix for the reported issue in the weekly patch release as previously communicated.


However, we are pleased to inform you that the fix has been planned for inclusion in our upcoming weekly patch release, scheduled for May 19, 2026.


Thank you for your patience and understanding.


Regards,

Praveen Sellappan



DP Dimitrije Prosevski May 7, 2026 07:02 PM UTC

That is great, thanks!



JA Jafar Ali Shahulhameed Syncfusion Team May 26, 2026 07:38 AM UTC

Hi Dimitrije, 

We have included a fix for the issue "DropDownTree: Node fails to select when value property is set before dataSource assignment" in our latest release version 33.2.7. We recommend upgrading to the latest version to resolve this issue. We have included the sample for your reference,


Sample: https://stackblitz.com/edit/angular-y2vhc7ok-n3v5jdft?file=package.json,src%2Fapp.component.ts

Release Notes: https://ej2.syncfusion.com/angular/documentation/release-notes/33.2.7?type=all#dropdowntree


Root Cause:

When saved selections are processed before all options are fully loaded. This can cause some valid selections to be missed and not restored afterward.

Regards, 
Jafar Ali S


Marked as answer

DP Dimitrije Prosevski replied to Jafar Ali Shahulhameed May 29, 2026 08:37 PM UTC

Thank you!



Loader.
Up arrow icon