Skip to content

Commit

Permalink
Fix: Categories Block: hierarchical Dropdown (#13567)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jorgefilipecosta authored Jan 31, 2019
1 parent 6e4e9aa commit a8dcfb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-library/src/categories/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }`;
Expand Down

0 comments on commit a8dcfb2

Please sign in to comment.