Skip to content

Commit

Permalink
Fixed #10504 - TreeSelect missing Tree option propagateSelectionDown …
Browse files Browse the repository at this point in the history
…and propagateSelectionUp
  • Loading branch information
yigitfindikli committed Aug 20, 2021
1 parent 28ccd4e commit 6b23e04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/treeselect/treeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const TREESELECT_VALUE_ACCESSOR: any = {
[@overlayAnimation]="{value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}" (@overlayAnimation.start)="onOverlayAnimationStart($event)" (@overlayAnimation.done)="onOverlayAnimationDone($event)">
<ng-container *ngTemplateOutlet="headerTemplate; context: {$implicit: value, options: options}"></ng-container>
<div class="p-treeselect-items-wrapper" [ngStyle]="{'max-height': scrollHeight}">
<p-tree [value]="options" [selectionMode]="selectionMode" (selectionChange)="onSelectionChange($event)" [selection]="value"
<p-tree [value]="options" [propagateSelectionDown]="propagateSelectionDown" [propagateSelectionUp]="propagateSelectionUp" [selectionMode]="selectionMode" (selectionChange)="onSelectionChange($event)" [selection]="value"
[metaKeySelection]="metaKeySelection" (onNodeExpand)="nodeExpand($event)" (onNodeCollapse)="nodeCollapse($event)"
(onNodeSelect)="onSelect($event)" (onNodeUnselect)="onUnselect($event)"></p-tree>
<div *ngIf="emptyOptions" class="p-treeselect-empty-message">
Expand Down Expand Up @@ -111,6 +111,10 @@ export class TreeSelect implements AfterContentInit {

@Input() appendTo: any;

@Input() propagateSelectionDown: boolean = true;

@Input() propagateSelectionUp: boolean = true;

@Input() get options(): any[] {
return this._options;
};
Expand Down
12 changes: 12 additions & 0 deletions src/app/showcase/components/treeselect/treeselectdemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,18 @@ <h5>Properties</h5>
<td>string</td>
<td>comma</td>
<td>Defines how the selected items are displayed, valid values are "comma" and "chip".</td>
</tr>
<tr>
<td>propagateSelectionUp</td>
<td>boolean</td>
<td>true</td>
<td>Whether checkbox selections propagate to ancestor nodes.</td>
</tr>
<tr>
<td>propagateSelectionDown</td>
<td>boolean</td>
<td>true</td>
<td>Whether checkbox selections propagate to descendant nodes.</td>
</tr>
<tr>
<td>metaKeySelection</td>
Expand Down

0 comments on commit 6b23e04

Please sign in to comment.