From a8dcfb242b3765e0e0a3d615b3cc6b204fd92b32 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Thu, 31 Jan 2019 12:29:05 +0000 Subject: [PATCH] Fix: Categories Block: hierarchical Dropdown (#13567) Previously higher than second levels categories here rendered multiple times on the categories block, when "Show Hierarchy" and "Display as Dropdown" options here true. This commit fixes that problem. --- packages/block-library/src/categories/edit.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/categories/edit.js b/packages/block-library/src/categories/edit.js index ad1dea3ec55bf..aee240e7384e6 100644 --- a/packages/block-library/src/categories/edit.js +++ b/packages/block-library/src/categories/edit.js @@ -106,7 +106,8 @@ class CategoriesEdit extends Component { } renderCategoryDropdown() { - const { showHierarchy, instanceId } = this.props; + const { instanceId } = this.props; + const { showHierarchy } = this.props.attributes; const parentId = showHierarchy ? 0 : null; const categories = this.getCategories( parentId ); const selectId = `blocks-category-select-${ instanceId }`;