-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Moving FocusTrapZone and Modal from react-next to react-internal #15368
Conversation
packages/react-internal/src/components/Dialog/__snapshots__/Dialog.deprecated.test.tsx.snap
Outdated
Show resolved
Hide resolved
Can you delete the FocusTrapZoneNext perf-tests and vr-tests? |
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 38e924b:
|
…g resetIds beforeEach and afterAll tests that were affected by these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some things got reverted that shouldn't have been, due to changes missing from react-next.
packages/react-internal/src/components/FocusTrapZone/FocusTrapZone.types.ts
Outdated
Show resolved
Hide resolved
Asset size changes
Over Tolerance (1024 B) Over Baseline Below Baseline New Removed 1 kB = 1000 B Baseline commit: 72907bfda0cd61232232c62de4448b6bfabd487f (build) |
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
packages/react-internal/src/components/Dialog/__snapshots__/Dialog.deprecated.test.tsx.snap
Outdated
Show resolved
Hide resolved
} else if (!newForceFocusInsideTrap || newDisabled) { | ||
// Transition from forceFocusInsideTrap / FTZ enabled to disabled. | ||
returnFocusToInitiator(); | ||
if (unmodalize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this part! However I think it needs to be handled a bit differently to replicate the class component behavior: the unmodalize
callback should be stored in internalState
, and in addition to this part you'll need to add another useEffect for componentWillUnmount.
I started trying to make this change last night and then noticed potentially a bunch of other issues with lifecycles that may not have been ported properly...so we definitely want to test this one carefully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I did this properly but let me know which other issues you've found.
Hello @khmakoto! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Pull request checklist
$ yarn change
Description of changes
This PR moves the versions of
Modal
andFocusTrapZone
existing in@fluentui/react-next
to@fluentui/react-internal
. As part of this API and snapshots were updated, the@fluentui/react-next
examples, vr tests and perf tests of these components were removed, and the versions of these components in@fluentui/react-next
now re-export the versions in@fluentui/react-internal
.Another change in this PR is that
resetIds
is now being called in those tests that were affected by this change.Focus areas to test
(optional)