Skip to content

Conversation

@tsullivan
Copy link
Owner

@tsullivan tsullivan commented Oct 30, 2025

Summary

Closes elastic#9159

The fix makes push padding conditional on managed state and active ownership. Only the active push flyout applies body padding, and as soon as it becomes inactive (e.g., when an overlay flyout takes over), the code synchronously clears that padding and its related CSS variable. Moving the padding logic into useLayoutEffect ensures the body is updated before paint and before any measurement by scroll-lock utilities, eliminating race conditions and layout shifts.

Additionally, the changes coordinate scroll locking with push state. A mutation observer tracks whether push padding is present; overlay flyouts only enable scroll lock when no push padding remains. This prevents conflicts between push and overlay sessions, guarantees the page is “unpushed” when switching to overlay, and avoids visual flicker or inconsistent measurements.

Screenshots

  • Before

    push padding fix - before

  • After

    push padding fix - after

Checklist

  • This was checked in mobile
  • This was checked in IE11
  • This was checked in dark mode
  • Any props added have proper autodocs
  • Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • This was checked for breaking changes and labeled appropriately
  • Jest tests were updated or added to match the most common scenarios
  • This was checked against keyboard-only and screenreader scenarios
  • This required updates to Framer X components

@github-actions
Copy link

👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually?

@tsullivan tsullivan force-pushed the flyout-system/fix-overlay-subsequent branch from 68ff561 to 6aeec7b Compare November 10, 2025 21:49
@tsullivan tsullivan force-pushed the flyout-system/fix-overlay-subsequent branch from 471a13a to 4b95cb8 Compare November 11, 2025 19:39
@tsullivan
Copy link
Owner Author

Replacing with elastic#9207

@tsullivan tsullivan closed this Nov 11, 2025
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.

2 participants