Skip to content
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

fix(Popper): prevented page scroll when popper opens #10725

Closed

Conversation

thatblindgeye
Copy link
Contributor

@thatblindgeye thatblindgeye commented Jul 11, 2024

What: Closes #10511

This essentially sort of "hides" the popper element until it should be visible. It does look to resolve the original issue of the popper causing the page to scroll, but it also breaks focus management when opening a Dropdown due to how we're handling that in the components. We'd have to essentially set the setTimeout in Dropdown/Select to something other than 0 in the handleClick handler, or pass the same logic to focus the first item to Popper's onShown prop. That said, this also looks to reintroduce the visual bug where the popper content appears in the wrong position first and then adjusts to the correct position, causing a sort of "flicker" effect.

As a note, one comment in the issue was about the position: relative styling on the Toolbar and ToolbarContent being one of the causes of the issue, and can confirm that removing that styling from both did resolve the issue. Though most likely not something we'd want to update in Core as I assume we need that relative positioning there.

A simpler work around may be setting the appendTo on Dropdown/whatever popper element to () => document.body manually (which will be the default behavior for Popper, Dropdown, and Select itself in v6), as that should resolve the scrolling issue as well.

Additional issues:

@thatblindgeye thatblindgeye force-pushed the iss10511_popperScrolling branch from 35ac13d to 061213e Compare July 11, 2024 12:38
@patternfly-build
Copy link
Contributor

patternfly-build commented Jul 11, 2024

@tlabaj tlabaj requested review from kmcfaul, mattnolting, a team and tlabaj and removed request for a team July 11, 2024 14:23
@thatblindgeye thatblindgeye marked this pull request as draft July 11, 2024 14:29
@thatblindgeye
Copy link
Contributor Author

Just a note that this will remain in draft for now. We merged in a workaround in #10746 , but an alternative solution like what this draft is attempting will require more dedicated time.

@thatblindgeye
Copy link
Contributor Author

Closing as #10797 went in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug - Toolbar - page scrolls when controls are clicked
2 participants