Skip to content

Commit

Permalink
Merge pull request #15380 from LinkTheFirstFlame/master
Browse files Browse the repository at this point in the history
Fix #15379 : TreeSelect onFilter returned object
  • Loading branch information
cetincakiroglu authored Apr 26, 2024
2 parents 9e53eec + e40262c commit 4292491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app/components/tree/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ export class UITreeNode implements OnInit {
</div>
<ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
<div *ngIf="filter" class="p-tree-filter-container">
<input #filter type="text" autocomplete="off" class="p-tree-filter p-inputtext p-component" [attr.placeholder]="filterPlaceholder" (keydown.enter)="$event.preventDefault()" (input)="_filter($event.target.value)" />
<input #filter type="search" autocomplete="off" class="p-tree-filter p-inputtext p-component" [attr.placeholder]="filterPlaceholder" (keydown.enter)="$event.preventDefault()" (input)="_filter($event.target.value)" />
<SearchIcon *ngIf="!filterIconTemplate" [styleClass]="'p-tree-filter-icon'" />
<span *ngIf="filterIconTemplate" class="p-tree-filter-icon">
<ng-template *ngTemplateOutlet="filterIconTemplate"></ng-template>
Expand Down
8 changes: 4 additions & 4 deletions src/app/components/treeselect/treeselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { SearchIcon } from 'primeng/icons/search';
import { TimesIcon } from 'primeng/icons/times';
import { Overlay, OverlayModule } from 'primeng/overlay';
import { RippleModule } from 'primeng/ripple';
import { Tree, TreeModule, TreeNodeSelectEvent, TreeNodeUnSelectEvent } from 'primeng/tree';
import {Tree, TreeFilterEvent, TreeModule, TreeNodeSelectEvent, TreeNodeUnSelectEvent} from 'primeng/tree';
import { ObjectUtils, UniqueComponentId } from 'primeng/utils';
import { Nullable } from 'primeng/ts-helpers';
import { AutoFocusModule } from 'primeng/autofocus';
Expand Down Expand Up @@ -126,7 +126,7 @@ export const TREESELECT_VALUE_ACCESSOR: any = {
<div class="p-treeselect-filter-container">
<input
#filter
type="text"
type="search"
autocomplete="off"
class="p-treeselect-filter p-inputtext p-component"
[attr.placeholder]="filterPlaceholder"
Expand Down Expand Up @@ -453,7 +453,7 @@ export class TreeSelect implements AfterContentInit {
* Callback to invoke when data is filtered.
* @group Emits
*/
@Output() onFilter: EventEmitter<any> = new EventEmitter<any>();
@Output() onFilter: EventEmitter<TreeFilterEvent> = new EventEmitter<TreeFilterEvent>();
/**
* Callback to invoke when a node is unselected.
* @param {TreeNodeUnSelectEvent} event - node unselect event.
Expand Down Expand Up @@ -699,7 +699,7 @@ export class TreeSelect implements AfterContentInit {
this.filterValue = (event.target as HTMLInputElement).value;
this.treeViewChild?._filter(this.filterValue);
this.onFilter.emit({
originalEvent: event,
filter: this.filterValue,
filteredValue: this.treeViewChild?.filteredNodes
});
setTimeout(() => {
Expand Down

0 comments on commit 4292491

Please sign in to comment.