Skip to content

Conversation

@gastonframirez
Copy link
Contributor

Current Behavior

When using the Modal component (or Dialog) the popup component that is being used under the hood cannot be configured. In cases where were need to have a different behavior for the onRestoreFocus method, we have no way to configure it while using either the Dialog or Modal components.

New Behavior

Adding the IPopupProps as a property of the Modal component and then passing it to the popup being used under the hood, we provide more flexibility on that popup's configuration.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 7, 2022

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 80d0408:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@size-auditor
Copy link

size-auditor bot commented Sep 7, 2022

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-Modal 88.559 kB 88.583 kB ExceedsBaseline     24 bytes
office-ui-fabric-react fluentui-react-Dialog 198.521 kB 198.544 kB ExceedsBaseline     23 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 92bc886e6e3e5ec43847752941456666eb69d32b (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 7, 2022

📊 Bundle size report

🤖 This report was generated against 92bc886e6e3e5ec43847752941456666eb69d32b

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 7, 2022

Perf Analysis (@fluentui/react)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
BaseButton mount 1191 1195 5000
Breadcrumb mount 2961 2915 1000
Checkbox mount 2647 2636 5000
CheckboxBase mount 2396 2365 5000
ChoiceGroup mount 4403 4368 5000
ComboBox mount 1237 1312 1000
CommandBar mount 9627 9651 1000
ContextualMenu mount 11445 11277 1000
DefaultButton mount 1395 1404 5000
DetailsRow mount 3634 3623 5000
DetailsRowFast mount 3660 3604 5000
DetailsRowNoStyles mount 3465 3448 5000
Dialog mount 3096 3082 1000
DocumentCardTitle mount 586 584 1000
Dropdown mount 3269 3265 5000
FocusTrapZone mount 2054 2052 5000
FocusZone mount 1986 1970 5000
GroupedList mount 54371 60983 2
GroupedList virtual-rerender 25085 25606 2
GroupedList virtual-rerender-with-unmount 93668 94064 2
GroupedListV2 mount 572 547 2
GroupedListV2 virtual-rerender 520 541 2
GroupedListV2 virtual-rerender-with-unmount 548 576 2
IconButton mount 1933 1902 5000
Label mount 730 739 5000
Layer mount 4272 4256 5000
Link mount 835 828 5000
MenuButton mount 1680 1693 5000
MessageBar mount 2291 2382 5000
Nav mount 3305 3315 1000
OverflowSet mount 1372 1374 5000
Panel mount 2588 2574 1000
Persona mount 1257 1261 1000
Pivot mount 1656 1618 1000
PrimaryButton mount 1499 1522 5000
Rating mount 7040 7001 5000
SearchBox mount 1528 1546 5000
Shimmer mount 2896 2925 5000
Slider mount 2082 2029 5000
SpinButton mount 4747 4677 5000
Spinner mount 810 809 5000
SplitButton mount 3104 3109 5000
Stack mount 867 873 5000
StackWithIntrinsicChildren mount 2347 2333 5000
StackWithTextChildren mount 4817 4820 5000
SwatchColorPicker mount 10507 10456 5000
TagPicker mount 2612 2775 5000
TeachingBubble mount 88865 89425 5000
Text mount 779 754 5000
TextField mount 1588 1609 5000
ThemeProvider mount 1516 1523 5000
ThemeProvider virtual-rerender 1079 1083 5000
ThemeProvider virtual-rerender-with-unmount 2061 2148 5000
Toggle mount 1116 1090 5000
buttonNative mount 555 558 5000

Copy link
Contributor

@smhigley smhigley left a comment

Choose a reason for hiding this comment

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

Just the one comment, otherwise I like this change :)

(isModalOpen && modalResponsiveMode! >= (responsiveMode || ResponsiveMode.small) && (
<Layer ref={mergedRef} {...mergedLayerProps}>
<Popup
{...popupProps}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest spreading this at the bottom, so it allows overriding the role, label, description, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated :) Thanks @smhigley !

@gastonframirez gastonframirez force-pushed the gasramirez/adding_popup_config_on_modal_component branch from 4853567 to 80b9d0b Compare September 7, 2022 16:33
@gastonframirez
Copy link
Contributor Author

Hi @Hotell, would you be able to approve the pending workflows so I can publish this PR if those pass? Thanks!

@gastonframirez gastonframirez marked this pull request as ready for review September 14, 2022 08:29
@gastonframirez gastonframirez requested review from a team as code owners September 14, 2022 08:29
@gastonframirez
Copy link
Contributor Author

Hi @Hotell it looks like we need to run the pipelines again, would you be able to trigger a new run? Thanks!

@gastonframirez gastonframirez force-pushed the gasramirez/adding_popup_config_on_modal_component branch from 80b9d0b to 80d0408 Compare September 21, 2022 14:43
@smhigley smhigley enabled auto-merge (squash) September 21, 2022 16:58
@smhigley smhigley merged commit 62aadfe into microsoft:master Sep 21, 2022
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Sep 24, 2022
* master: (29 commits)
  chore(react-tooltip): update package scaffold (microsoft#24927)
  chore(react-popover): update package scaffold (microsoft#24925)
  chore(react-overflow): update package scaffold (microsoft#24926)
  chore(react-menu): update package scaffold (microsoft#24924)
  applying package updates
  chore: Bump workspace-tools to 0.27.0 (microsoft#24914)
  fix: Make Menu openOnHover prop work again (microsoft#24899)
  stress test: convert cli scripts to typescript (microsoft#24915)
  update package manifest to only include v8 controls (microsoft#24839)
  Stress Test: add random tree (microsoft#24896)
  chore: Expand scope of dependency mismatch generator (microsoft#24880)
  chore: run dependency mismatch generator in release pipeline (microsoft#24881)
  chore: scaffolds react-trigger package (microsoft#24887)
  applying package updates
  chore: a11y docs structure update (microsoft#24871)
  feat: add popupProps to Modal component to allow override internal Popup props (microsoft#24693)
  fix: Set github user in nightly release pipeline (microsoft#24850)
  chore(react-aria): restructure folder organization (microsoft#24884)
  ci(github): fix invalid json string in issues.yml v2 (microsoft#24886)
  Add react-components/unstable to tsconfig aliases (microsoft#24878)
  ...
NotWoods pushed a commit to NotWoods/fluentui that referenced this pull request Nov 18, 2022
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.

5 participants