Skip to content

TaxonomyPicker: don't suggest terms that are not available for tagging (fixes #2110) - #2200

Open
ashokghoghari wants to merge 1 commit into
pnp:devfrom
ashokghoghari:fix/2110-taxonomy-search-unavailable-terms
Open

ashokghoghari wants to merge 1 commit into
pnp:devfrom
ashokghoghari:fix/2110-taxonomy-search-unavailable-terms

Conversation

@ashokghoghari

@ashokghoghari ashokghoghari commented Nov 19, 2026 •

Copy link
Copy Markdown
Q A
Bug fix? [x]
New feature? [ ]
New sample? [ ]
Related issues? fixes #2110

What's in this Pull Request?

TaxonomyPicker: terms with Available for Tagging set to false are disabled in the term tree, but they were still offered as search suggestions when typing in the picker, and could be selected from there.

Cause: SPTermStorePickerService.searchTermsByTermSet called the suggestion service with isIncludeUnavailable: this.props.hideTagsNotAvailableForTagging !== true, so unavailable terms were included in suggestions unless hideTagsNotAvailableForTagging was set.

Fix: always request suggestions with isIncludeUnavailable: false. These terms can never be selected, so they should not be suggested either. The tree is unchanged: the terms stay visible there (greyed out) and their child terms remain selectable, as requested in the issue. hideDeprecatedTags handling is unchanged.

Tests: added tests/services/SPTermStorePickerService.test.ts (3 tests), which checks the suggestion request body. The main test fails before the change and passes after.

  • heft test --clean --production: builds cleanly, 96 tests pass.
  • npx jest (tests/ suite): the new tests pass. The 7 failing suites and the SPService › getListItems "test filter" failure are the same on unmodified dev.

I have not tested this against a live tenant.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the first contribution to this project.

…agging

Terms with "Available for Tagging" set to false are disabled in the
term tree, but the search suggestions requested them from the
suggestion service unless hideTagsNotAvailableForTagging was set, so
they could still be selected by typing in the picker.

Always request suggestions with isIncludeUnavailable: false. The tree
is unchanged, so these terms stay visible there and their child terms
remain selectable.

Fixes pnp#2110
@ashokghoghari
ashokghoghari force-pushed the fix/2110-taxonomy-search-unavailable-terms branch from 9620e48 to 0779960 Compare November 19, 2026 09:57

This branch has not been deployed

No deployments
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.

TaxonomyPicker allows selecting terms with Available for Tagging set to false via search

1 participant