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

chore(react-tag-picker): ensure no toggle behaviour when re-selecting already selected data #33344

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bsunderhus
Copy link
Contributor

@bsunderhus bsunderhus commented Nov 26, 2024

Previous Behavior

At the moment whenever the user tries to re-select the same option, the option is unselected. This happens because we're using Combobox logic internally to implement TagPicker logic, but this is a bit problematic in this scenario as Combobox supports toggling the selected data on the "option select event", meanwhile TagPicker only allows selection on the "option select event", to unselect a tag should be clicked manually, it does not involve the combobox logic

New Behavior

  1. adds conditional logic to ensure internal combobox state will not be updated in this scenario. Instead, onOptionsSelect should be invoked with the current selectedOptions with no modifications

Related Issue(s)

@bsunderhus bsunderhus self-assigned this Nov 26, 2024
Copy link

github-actions bot commented Nov 26, 2024

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: entire library
1.163 MB
291.198 kB
1.163 MB
291.244 kB
210 B
46 B
react-tag-picker
@fluentui/react-tag-picker - package
184.105 kB
55.426 kB
184.329 kB
55.49 kB
224 B
64 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.21 kB
20.174 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
220.63 kB
63.913 kB
react-components
react-components: FluentProvider & webLightTheme
44.447 kB
14.59 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
react-timepicker-compat
TimePicker
107.39 kB
35.763 kB
🤖 This report was generated against c814fe6893d80e3f562ed872b81bef4d79821f3d

Copy link

Pull request demo site: URL

@bsunderhus bsunderhus marked this pull request as ready for review November 26, 2024 10:46
@bsunderhus bsunderhus requested a review from a team as a code owner November 26, 2024 10:46
@bsunderhus bsunderhus closed this Nov 26, 2024
@bsunderhus bsunderhus reopened this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: TagPicker - Toggle behavior while adding a value that is already selected
3 participants