-
Notifications
You must be signed in to change notification settings - Fork 41
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
Re-add nested portals #2297
Re-add nested portals #2297
Conversation
DatePicker
self focus *after* portalingThere 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.
This needs a changeset because it has a pretty noticeable impact for users. And doesn't it also fix #2245?
Added the changeset nearly identical to the one from #2209. Can make it more specific if needed. Didn't think it was needed since the exact details of the fix in #2209 weren't added in its changeset.
Yes, it fixes #2245 and #2291. I tested it by confirming that the nested popovers in the playgrounds' code no longer close unexpectedly. |
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.
LGTM!
@mayank99 when can we expect this PR to merge in and a patch published including it? This is needed to resolve a blocker for our pending release and it seems like the PR is approved, so I'm hoping this can complete and publish today? |
This patch fix has now been released in 3.15.4 🚀 |
Changes
Reverts #2209 as the fix for #2205 (comment). Did this revert after internal discussion after we realized that a simpler alternative fix also works.
The simpler alternative to #2209 is to move focus to the DatePicker's today's date (second popover) only after it has been portaled to be a descendant of
DateRangeFilter
. Since floating-ui'sFloatingFocusManager
uses DOM events instead of React events (floating-ui/floating-ui#3060), waiting for the second popover to be portaled within the first is important to prevent a focus out being triggered on the first popover.Additionally, I was unable to figure out how #2209 fixed the bug. Because after #2209, the second popover was moved outside the DOM of the first popover. So, focusing the second popover should be treated as a focus out of the first popover prompting the first popover to close. But it didn't. Since we're unable to figure out why it happens, reverting is safer as it brings a more reliable and predictable state.
Testing
cy.wait()
), I manually confirmed that focus moves correctly to the expected element in the floating content.Docs
Not sure if a changeset is needed since I don't think it's a significant user facing change.
After PR TODO: