I seem to be having 2 issues with the dropdown tree component.
Hi Ken,
Greetings from Syncfusion support.
Issue 1: Trouble with capturing key press events.
We have validated the mentioned issue in the Angular Dropdown Tee component and are able to reproduce the issue on our end. We have considered the reported issue a bug, and the fix for this issue will be included any of our upcoming releases.
You can track the status of the issue's fix using the following feedback link:
Issue 2: If you dynamically add to the dropdown list that has selected items, the selections are removed
We have validated your reported issue in the Angular Dropdown Tree component. By default, you need to properly refresh the component in order to see the output if you dynamically change any component values. The reported issue also occurs due to the Dropdown Tree component not being properly refreshed while dynamically adding the nodes.
To overcome the reported issue, you need to call the refresh method inside the button's click event. Also, instead of using the value property, you must use the selected property in the field by setting the value to true for the corresponding nodes in the datasource.
Check out the below code snippets and sample.
[drop-down-tree-test.component.html] <ejs-dropdowntree #studentDropdown id="studentDropdown" <!-- [(value)]="studentListSelected" --> [fields]="{ dataSource: studentList$.value, value: 'id', text: 'name', parentValue: 'pid', hasChildren: 'hasChild', selected: 'selected' }" ... ></ejs-dropdowntree>
[drop-down-tree-test.component.ts] //studentListSelected = ['3', '9'];
addENGStudents(event: any) { this.studentList$.next([ ...this.studentList$.value, ...this.studentList_ENG, ]); this.studentDropdown.refresh(); }
studentList_PHY: any[] = [ ... { id: '3', lastName: 'Hardin', firstName: 'Reid (Make it a long name)', middleName: 'Raymond', grade: 'Sophomore', class: 'PHY', major: 'English', selected: true, }, ... ];
studentList_ENG: any[] = [ ...{ id: '9', lastName: 'Chang', firstName: 'Matthew (Make it a long name)', middleName: 'K', grade: 'Junior', class: 'ENG', major: 'English', selected: true, }, ... ]; |
Regards,
Leo Lavanya Dhanaraj
Ken, You are encountering a behavior with the Dropdown Tree component when the allowFiltering option is set to true. In order to move down through the tree nodes using the Down Arrow key, you may need to first use the Tab key to focus on the Tree element. This should allow the keyPress event to trigger properly.
Check out the below sample.
Please get back to us if you need any further assistance.