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

[TaxonomyPicker] Enhancements

Open
#1,871 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Category

[✅] Enhancement

[ ] Bug

[ ] Question

Version

Please specify what version of the library you are using: 3.20.0

Expected / Desired Behavior / Question
  1. The first problem is that in single selection mode (allowMultipleSelections: false) the control doesn't lose focus if you select a term using inline search and not a panel, which is demonstrated below:

2024-08-21_11-08-48

  1. The second issue (an enhancement, actually) is a way of selecting a term in the panel. If the control is in a single selection mode (allowMultipleSelections: false), then you have to click two times to select a term - one to select it and second time to click "Save". But since you cannot select more than one in this case, after selecting the first term we can simply close the panel.

This is how it works now:

2024-08-21_11-12-42

The suggested change (we don't have any Save/Cancel buttons):

2024-08-21_14-06-10

In order not to break existing functionality the idea is to introduce a new property, say simpleSelectionInSingleMode which is false by default. When true (and allowMultipleSelections: false), then the above behaviour will be activated.

If you approve, I will make a PR.

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 implementation and trace single-selection behavior through inline search and panel selection. Check how focus, Save/Cancel controls, and allowMultipleSelections are handled, then verify that the opt-in simpleSelectionInSingleMode behavior works without changing the default and that focus is released after inline selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.