Skip to content

fix(treeselect): emit onFilter when the user types in the filter input - #1421

Open
marmotz wants to merge 1 commit into
openng-org:mainfrom
marmotz:256-treeselect-onfilter-event
Open

fix(treeselect): emit onFilter when the user types in the filter input#1421
marmotz wants to merge 1 commit into
openng-org:mainfrom
marmotz:256-treeselect-onfilter-event

Conversation

@marmotz

@marmotz marmotz commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

p-treeSelect's onFilter output was never emitted: the component's own onFilterInput method was dead code, since the filter <input> is actually rendered inside the internal p-tree (which has its own onFilter output that nothing was listening to).
This fix wires (onFilter)="onFilterInput($event)" on the internal <p-tree>, and updates onFilterInput to accept the TreeFilterEvent emitted by p-tree, sync filterValue/filteredNodes, and re-emit it as TreeSelect's own onFilter event.
Before: typing in the filter box never fired onFilter on p-treeSelect.
After: onFilter fires with the current filter value and filteredValue, as documented.

Related issues

Fixes #256

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes the public API)
  • Documentation only
  • Refactor, test, or chore (no user-facing change)

Breaking changes

None

Test plan

  • npm run build
  • npm test
  • npm run lint
  • Verified in the demo app (if applicable)

Checklist

  • Issue discussed or bug clearly described (link issue when applicable)
  • Tests added or updated for behavioral changes
  • Documentation updated (README, JSDoc, migration notes as needed)
  • Public API changes documented; breaking changes called out
  • CHANGELOG updated (if the repository maintains one and the change is user-facing)
  • Commit messages follow Conventional Commits
  • I agree to follow the OpenNG Foundation Code of Conduct

Additional context

Multiple users confirmed the same root cause and workaround in the issue comments (subscribing to the internal p-tree's onFilter and relaying it manually), this PR implements the equivalent fix directly in TreeSelect.

@marmotz
marmotz force-pushed the 256-treeselect-onfilter-event branch from ce003fe to 3e35351 Compare July 31, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

p-treeselect onFilter Event is never thrown, since method onFilterInput is never in use

1 participant