Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TagPicker needs to filter items when TagPickerOption contains children other then Text (control or only string). #31431

Closed
1 task done
ravindersharma opened this issue May 21, 2024 · 3 comments · Fixed by #31474

Comments

@ravindersharma
Copy link

ravindersharma commented May 21, 2024

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

Current working : When we use the options as string Array in TagPicker, pass TagPickerOption as Given below its filter feature working fine.
<TagPickerOption secondaryContent="Microsoft FTE" media={ <Avatar shape="square" aria-hidden name={option} color="colorful" /> } value={option} key={option} > {option} </TagPickerOption>

Needed Feature: In case we are using an object Array or even string Array an pass a Persona Control as children for TagPickerOption it stops filtering item.

Expected Issue: Since current working example have String Array and Have Text as children for TagPickerOption it search easily. but in Persona case we don't have any text property for TagPickerOption to pass. In that case it stops working.
<TagPickerOption value={option} key={option}> <Persona avatar={{ color: 'colorful', 'aria-hidden': true, }} name={option} secondaryText="Microsoft FTE" /> </TagPickerOption>

Please check Following example for clarity:
https://stackblitz.com/edit/sknhsb-7t6uwy?file=src%2Fexample.tsx

Here is Related issue : #26652

Have you discussed this feature with our team

No response

Additional context

No response

Validations

  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Priority

High

@ravindersharma ravindersharma changed the title [Feature]: TagPicker needs to filter items when TagPickerOption contains children other then Text (control or only string). TagPicker needs to filter items when TagPickerOption contains children other then Text (control or only string). May 21, 2024
@bsunderhus bsunderhus self-assigned this May 22, 2024
@bsunderhus
Copy link
Contributor

I'm not sure I follow what do you mean by filtering in the example you provided, there's no filtering happening anywhere...

Do you mean that the focus is not properly focusing in the TagPickerOption that is the closest to the provided input?

@ravindersharma
Copy link
Author

Hi @bsunderhus , yes you are right, here I mean filtering feature is, what currently shown as Focus for TagPicker when you search for any user name in example code. For example, if you type Ja you will get "Jane Doe" user focused in "Select Employees with Text" TagPicker.

image

But if you do same in "Select Employees With Persona" TagPicker you will get no Focused options.

image

@pradeept95
Copy link

pradeept95 commented May 23, 2024

Hi @bsunderhus , Combobox have text props in there option to handle complex option scenario but TagPickerOption lags that. I think this is the main reason we are seeing this warning in console.

I believe it is main reason for the above issue as well.

https://react.fluentui.dev/?path=/docs/components-combobox--default#complex-options

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants