pnp / pnp/sp-dev-fx-controls-react
TaxonomyPicker allows selecting terms with Available for Tagging set to false via search
Nobody has claimed this yet.
- 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.
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.
Example term set:
AAhas Available for Tagging set tofalseBhas Available for Tagging set tofalse
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
- Create or use a term set with at least the following terms:
AAAAAAAABABABAABBBBABB
- Set Available for Tagging to
falseforAAandB. - Add a
TaxonomyPickerto an SPFx web part. - Configure the picker to use the term set.
- Open the picker panel and confirm that
AAandBare disabled in the tree and cannot be selected there. - Type
AAorBin the picker input/search field. - Select the matching term from the search suggestions.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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