pnp / pnp/sp-dev-fx-controls-react

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

Open
#2,110 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
TypeScript
Stars
433
Forks
418
Avg merge
5d 6m
Merged PRs (30d)
19

Description

Category

[x] Bug

Version

Version of the library: [@pnp/spfx-controls-react 4.0.0-beta.6059091]

The same behavior was also reproduced with [@pnp/spfx-controls-react 3.24.0].

SPFx version: 1.17.3

Expected / Desired Behavior / Question

Terms where Available for Tagging is set to false should not be selectable in the TaxonomyPicker.

In the term tree, these terms are shown as disabled and cannot be selected. They should remain visible in the tree because their child terms may still be available for tagging and need to remain selectable. The same restriction should be applied when searching or typing in the picker field: disabled terms should either not appear in search suggestions or should appear as disabled and not be selectable.

Observed Behavior

Terms where Available for Tagging is set to false are disabled in the taxonomy tree and cannot be selected from the tree.

Image

However, the same terms can still be found by typing in the picker field/search and can be selected from the search suggestions. After selection, they are added to the picker value as selected terms.

Image Image

Example term set:

  • AA has Available for Tagging set to false
  • B has Available for Tagging set to false

Both AA and B cannot be selected from the tree, but they can be searched and selected through the picker input.

The goal is not to hide AA and B from the tree, because their child terms such as AAA, AAB, BA, and BB still need to be reachable and selectable when they are available for tagging.

Steps to Reproduce
  1. Create or use a term set with at least the following terms:
    • A
    • AA
    • AAA
    • AAB
    • AB
    • ABA
    • ABB
    • B
    • BA
    • BB
  2. Set Available for Tagging to false for AA and B.
  3. Add a TaxonomyPicker to an SPFx web part.
  4. Configure the picker to use the term set.
  5. Open the picker panel and confirm that AA and B are disabled in the tree and cannot be selected there.
  6. Type AA or B in the picker input/search field.
  7. Select the matching term from the search suggestions.
  8. Observe that the disabled term is added to the selected terms.

Example picker configuration:

<TaxonomyPicker
  allowMultipleSelections={true}
  context={context}
  isTermSetSelectable={false}
  label="Test term set"
  onChange={onTaxonomyPickerChange}
  panelTitle="Test Terms"
  termsetNameOrID="{termsetID}"
/>

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the TaxonomyPicker entry point and trace how the tree disables terms marked Available for Tagging=false versus how search suggestions handle them. Reproduce the example with AA and B, then ensure search results preserve visibility where needed but do not allow disabled terms to be selected, while available child terms remain reachable.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.