microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.06k stars 2.69k forks source link

TagPicker #26652

Closed paulgildea closed 2 months ago

paulgildea commented 1 year ago

💡 When you create a PR for any of the checklist items, add a link to this Epic under the PR's Related Issues section.

Preparation

Implementation

Validation

Dev TODOs

pradeept95 commented 11 months ago

Can we have implementation of this component accelerated in V9 please. This is the one major component, and because of it we are not able to completely move to V9. We have both V8 and V9 dependencies on our projects and PeoplePicler is the one major component which is stopping us to get rid of V8 dependencies in our projects.

briandrouin commented 8 months ago

Design Contact: Toshie

ADO task

gouttierre commented 8 months ago

📢"A meeting to align with Teams team and the designers will be scheduled. In the interim, Toshie has aligned with Ling to share implementation thoughts."

miroslavstastny commented 7 months ago

Moving the ETA from Dec 2023 to Feb 2024. We are currently in a prototyping phase, missing design spec. cc @gouttierre

gouttierre commented 7 months ago

📢

briandrouin commented 7 months ago

Ling is prototyping, Toshie is working on spec.

gouttierre commented 7 months ago

📢"Ling is doing the implementation and prototyping. Toshie is moving forward with the design spec and addressing the accessibility concerns with Kay."

gouttierre commented 5 months ago

📢

gouttierre commented 5 months ago

📢

gouttierre commented 5 months ago

📢

gouttierre commented 4 months ago

📢

gouttierre commented 3 months ago

📢

cc @tudorpopams , @JustSlone, @ling1726, @bsunderhus

bsunderhus commented 3 months ago

First preview release officially available https://www.npmjs.com/package/@fluentui/react-tag-picker-preview

pradeept95 commented 3 months ago

Hi @bsunderhus , I exported example to Stackblitz and I got following error. It is same for local project as well!

✘ [ERROR] Could not resolve "../../../react-combobox/src/utils/useOptionCollection"

node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:2:36:
  2 │ ...ion } from '../../../react-combobox/src/utils/useOptionCollection';
    ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "../../../react-combobox/src/utils/useSelection"

node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:3:29:
  3 │ ...eSelection } from '../../../react-combobox/src/utils/useSelection';
    ╵                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: Build failed with 2 errors: node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:2:36: ERROR: Could not resolve "../../../react-combobox/src/utils/useOptionCollection" node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:3:29: ERROR: Could not resolve "../../../react-combobox/src/utils/useSelection" at failureErrorWithLog (/home/projects/iz2jvs--run/node_modules/esbuild/lib/main.js:1641:15) at eval (/home/projects/iz2jvs--run/node_modules/esbuild/lib/main.js:1049:25) at eval (/home/projects/iz2jvs--run/node_modules/esbuild/lib/main.js:1517:9) { errors: [Getter/Setter], warnings: [Getter/Setter]

Link : https://stackblitz.com/run?file=src%2Fexample.tsx

image

bsunderhus commented 3 months ago

Hi @bsunderhus , I exported example to Stackblitz and I got following error. It is same for local project as well!

✘ [ERROR] Could not resolve "../../../react-combobox/src/utils/useOptionCollection"

node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:2:36:
  2 │ ...ion } from '../../../react-combobox/src/utils/useOptionCollection';
    ╵               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "../../../react-combobox/src/utils/useSelection"

node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:3:29:
  3 │ ...eSelection } from '../../../react-combobox/src/utils/useSelection';
    ╵                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: Build failed with 2 errors: node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:2:36: ERROR: Could not resolve "../../../react-combobox/src/utils/useOptionCollection" node_modules/@fluentui/react-tag-picker-preview/lib/utils/useComboboxBaseState.js:3:29: ERROR: Could not resolve "../../../react-combobox/src/utils/useSelection" at failureErrorWithLog (/home/projects/iz2jvs--run/node_modules/esbuild/lib/main.js:1641:15) at eval (/home/projects/iz2jvs--run/node_modules/esbuild/lib/main.js:1049:25) at eval (/home/projects/iz2jvs--run/node_modules/esbuild/lib/main.js:1517:9) { errors: [Getter/Setter], warnings: [Getter/Setter]

Link : https://stackblitz.com/run?file=src%2Fexample.tsx

image

Thanks for the catch @pradeept95, I'll investigate it immediately!

pradeept95 commented 3 months ago

Thank you so much it is working now!

Hi @bsunderhus , Quick question: I am using filtering option in TagPicker but when I type space in keyboard it select the first highlighted option, is there any way I can prevent that, Because I am using async denounced call to backend API while user typing name in the TagPickerInput field and api might have return intermediate multiple options but user still typing to filter out more which might contains space as well.

bsunderhus commented 3 months ago

Thank you so much it is working now!

Hi @bsunderhus , Quick question: I am using filtering option in TagPicker but when I type space in keyboard it select the first highlighted option, is there any way I can prevent that, Because I am using async denounced call to backend API while user typing name in the TagPickerInput field and api might have return intermediate multiple options but user still typing to filter out more which might contains space as well.

This seems like the request to support freeform https://react.fluentui.dev/?path=/docs/components-combobox--default#freeform

I'll take a look into it! 💪🏼

pradeept95 commented 3 months ago

Thank you so much!

bsunderhus commented 3 months ago

Thank you so much!

Newest version is available with freeform support @pradeept95

pradeept95 commented 3 months ago

Thank you so much. Indeed, solved my use case!

pradeept95 commented 3 months ago

I have created two new issues related to this component:

  1. 30984

  2. 30978

Please let me know if you have any questions!

bsunderhus commented 3 months ago

I have created two new issues related to this component:

Please let me know if you have any questions!

Thanks @pradeept95 , I'll follow them up. The keyborg related I believe it has nothing to do with TagPicker itself, we were having a similar issue with other Tabster related components

pradeept95 commented 3 months ago

Awesome, Thank you so much @bsunderhus!

gouttierre commented 2 months ago

📢

cc @bsunderhus , @ling1726, @tudorpopams , @JustSlone

pradeept95 commented 2 months ago

Hi @bsunderhus I have reported this issue, but what do you think about this? It seems bug to me!

https://github.com/microsoft/fluentui/issues/31259

bsunderhus commented 2 months ago

Hi @bsunderhus I have reported this issue, but what do you think about this? It seems bug to me!

31259

It is not a bug @pradeept95, after some discussions and investigations from our a11y champions, we've decided to go with this behaviour. Both Space and Enter click when selecting an option will close the dropdown

pradeept95 commented 1 month ago

It is great to see this is now in stable release. Thank you everyone for great work! thank you @bsunderhus!

ravindersharma commented 1 month ago

Hi @bsunderhus ,

I recently switched from PeoplePicker to TagPicker for the Fluent UI V8 version. However, there's an issue, which is related TagPickerOption, which is dependent on the Text (String) Property only and does not allow us to add other components as children. The Persona control loaded into TagPickerOption without any issues, but the Filter function started behaving weirdly when I tried to utilize it. This is because, the filter feature works on Text instead of any other component. If we could successfully add a text property to TagPickeroption and use it for the filter, that would be ideal. Or do we have an other option for it. I attached screenshot for both.

Here is a reference to the post that I followed to use it: https://github.com/microsoft/fluentui/discussions/29941

image

image

bsunderhus commented 1 month ago

Hi @bsunderhus ,

I recently switched from PeoplePicker to TagPicker for the Fluent UI V8 version. However, there's an issue, which is related TagPickerOption, which is dependent on the Text (String) Property only and does not allow us to add other components as children. The Persona control loaded into TagPickerOption without any issues, but the Filter function started behaving weirdly when I tried to utilize it. This is because, the filter feature works on Text instead of any other component. If we could successfully add a text property to TagPickeroption and use it for the filter, that would be ideal. Or do we have an other option for it. I attached screenshot for both.

Here is a reference to the post that I followed to use it: #29941

image

image

Hey there @ravindersharma, would you mind following up in a Feature request with an implementation detail and also some reproduction on why is this not working today?

ravindersharma commented 1 month ago

Hi @bsunderhus , I recently switched from PeoplePicker to TagPicker for the Fluent UI V8 version. However, there's an issue, which is related TagPickerOption, which is dependent on the Text (String) Property only and does not allow us to add other components as children. The Persona control loaded into TagPickerOption without any issues, but the Filter function started behaving weirdly when I tried to utilize it. This is because, the filter feature works on Text instead of any other component. If we could successfully add a text property to TagPickeroption and use it for the filter, that would be ideal. Or do we have an other option for it. I attached screenshot for both. Here is a reference to the post that I followed to use it: #29941 image image

Hey there @ravindersharma, would you mind following up in a Feature request with an implementation detail and also some reproduction on why is this not working today?

Hi @bsunderhus , As You have suggested, I have added it, here it is: https://github.com/microsoft/fluentui/issues/31431