@topconsultnpm/sdkui-react-beta 6.11.38 → 6.11.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,22 +24,24 @@ const TMTreeDropDown = (props) => {
24
24
  };
25
25
  // Synchronizes the selection in the TreeView when the dropdown value changes
26
26
  const syncTreeViewSelection = useCallback((e) => {
27
- const treeView = (e.component.selectItem && e.component) || (treeViewRef.current && treeViewRef.current.instance());
28
- if (treeView) {
29
- // If the value is null, unselect all items in the tree view
30
- if (e.value === null) {
31
- treeView.unselectAll();
27
+ setTimeout(() => {
28
+ const treeView = (e.component.selectItem && e.component) || (treeViewRef.current && treeViewRef.current.instance());
29
+ if (treeView) {
30
+ // If the value is null, unselect all items in the tree view
31
+ if (e.value === null) {
32
+ treeView.unselectAll();
33
+ }
34
+ else {
35
+ // Otherwise, select the items corresponding to the selected values
36
+ const treeValues = e.value || values;
37
+ treeValues && treeValues.forEach((value) => { treeView.selectItem(value); });
38
+ }
32
39
  }
33
- else {
34
- // Otherwise, select the items corresponding to the selected values
35
- const treeValues = e.value || values;
36
- treeValues && treeValues.forEach((value) => { treeView.selectItem(value); });
40
+ // Update the selected values in the state if the event contains a value
41
+ if (e.value !== undefined) {
42
+ setValues(e.value);
37
43
  }
38
- }
39
- // Update the selected values in the state if the event contains a value
40
- if (e.value !== undefined) {
41
- setValues(e.value);
42
- }
44
+ });
43
45
  }, [values]); // Dependency on 'values' state to update selection
44
46
  // Event handler for when item selection changes in the TreeView
45
47
  const treeViewItemSelectionChanged = useCallback((e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.11.38",
3
+ "version": "6.11.39",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",