From 679f9170e03388f58328f10935590213bf4978a7 Mon Sep 17 00:00:00 2001 From: Luca Stancapiano Date: Wed, 3 Nov 2021 08:07:31 +0100 Subject: [PATCH] Fixed #2372 - Treeselect resolution for node ids equals to 0 (#2375) * button extension to work with binary data * Treeselect resolution for node ids equals to 0 Here a solution to resolve the bug: https://github.com/primefaces/primereact/issues/2372 * Update TreeSelect.js Co-authored-by: flashboss Co-authored-by: Luca Stancapiano --- src/components/treeselect/TreeSelect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/treeselect/TreeSelect.js b/src/components/treeselect/TreeSelect.js index 0da9b7a429..4442357f6e 100644 --- a/src/components/treeselect/TreeSelect.js +++ b/src/components/treeselect/TreeSelect.js @@ -138,7 +138,7 @@ export class TreeSelect extends Component { getSelectedNodes() { let selectedNodes = []; - if (this.props.value && this.props.options) { + if (ObjectUtils.isNotEmpty(this.props.value) && this.props.options) { let keys = this.props.selectionMode === 'single' ? {[`${this.props.value}`]: true} : {...this.props.value}; this.findSelectedNodes(null, keys, selectedNodes); }