Skip to content

Commit

Permalink
* list: fix modifier class no-nested-items never work.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Aug 14, 2024
1 parent 11ed426 commit 48779a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/list/src/component/nested-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ export class NestedList<P extends NestedListProps = NestedListProps, S extends N
}

protected _renderItem(props: RenderableProps<P>, renderedItem: NestedItem, index: number): ComponentChildren {
if (this._hasNestedItems && renderedItem.type === 'item' && renderedItem.toggleIcon === undefined) {
if ((this._hasNestedItems || !this.isRoot) && renderedItem.type === 'item' && renderedItem.toggleIcon === undefined) {
renderedItem.toggleIcon = this._renderNestedToggle(props, renderedItem.expanded as boolean | undefined);
}
const nestedListContent = renderedItem.items ? this._renderNestedList(props, renderedItem.items, renderedItem, renderedItem.expanded as boolean) : null;
Expand Down Expand Up @@ -644,7 +644,7 @@ export class NestedList<P extends NestedListProps = NestedListProps, S extends N
protected _beforeRender(props: RenderableProps<P>): void | RenderableProps<P> | undefined {
this._renderedItemMap.clear();
this._hasIcons = false;
this._hasNestedItems = !this.isRoot;
this._hasNestedItems = false;
return super._beforeRender(props);
}
}

0 comments on commit 48779a0

Please sign in to comment.