Skip to content

Conversation

@kkakroo
Copy link
Contributor

@kkakroo kkakroo commented Jul 4, 2023

Previous Behavior

There was no property on AccordionToggleData which provided the consumer with the details of the current open items of the accordion which respect the multiple and collapsible props.

New Behavior

openItems prop has been added to AccordionToggleData of onToggle  which respects the multiple and collapsible prop and provides the user with the current open items.

Related Issue(s)

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 4, 2023

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
InfoButton mount 9 13 5000 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 600 609 5000
Button mount 312 295 5000
Field mount 1074 1022 5000
FluentProvider mount 648 652 5000
FluentProviderWithTheme mount 80 87 10
FluentProviderWithTheme virtual-rerender 65 64 10
FluentProviderWithTheme virtual-rerender-with-unmount 73 69 10
InfoButton mount 9 13 5000 Possible regression
MakeStyles mount 861 844 50000
Persona mount 1646 1612 5000
SpinButton mount 1290 1317 5000

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 4, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7b0267b:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration
determined-brook-vkjdns Issue #27718

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 4, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-accordion
Accordion (including children components)
88.547 kB
26.801 kB
88.591 kB
26.806 kB
44 B
5 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
208.091 kB
57.972 kB
208.135 kB
57.974 kB
44 B
2 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
67.544 kB
18.216 kB
react-components
react-components: FluentProvider & webLightTheme
36.409 kB
12.01 kB
react-portal-compat
PortalCompatProvider
6.48 kB
2.203 kB
🤖 This report was generated against 88bd423b47995eca9a23a8438405d55626be9ebf

@size-auditor
Copy link

size-auditor bot commented Jul 4, 2023

Asset size changes

⚠️ Insufficient baseline data to detect size changes

Unable to find bundle size details for Baseline commit: 325743f

Possible causes

  • The baseline build 325743f is broken
  • The Size Auditor run for the baseline build 325743f was not triggered

Recommendations

  • Please merge your branch for this Pull request with the latest master build and commit your changes once again

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 4, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 12, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

const open = useAccordionContext_unstable(ctx => ctx.openItems.includes(value));
const onAccordionHeaderClick = React.useCallback(
(ev: AccordionToggleEvent) => requestToggle(ev, { value }),
(ev: AccordionToggleEvent) => requestToggle(ev, { value, openItems: [] }),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a hack. instead of this, how about to simply modify requestToggle signature?

@bsunderhus
Copy link
Contributor

Closing this in favor of #28665

@bsunderhus bsunderhus closed this Aug 2, 2023
@kkakroo kkakroo deleted the accordion-openItems branch August 2, 2023 10:11
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]: controlled Accordion loses it's ability to follow on multiple and collapsible props

5 participants