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

Bug - Toolbar - page scrolls when controls are clicked #10511

Closed
dlabrecq opened this issue Jun 3, 2024 · 4 comments · Fixed by #10746
Closed

Bug - Toolbar - page scrolls when controls are clicked #10511

dlabrecq opened this issue Jun 3, 2024 · 4 comments · Fixed by #10746
Assignees
Milestone

Comments

@dlabrecq
Copy link
Member

dlabrecq commented Jun 3, 2024

Encountered an issue with the latest PatternFly milestone packages in Cost Management, which is blocking QE test automation.

When users click the pagination's page selector and/or the bulk select, the page scrolls so that the control's menu is out of view. These controls do not behave like this when located outside the Toolbar. For example, the bottom pagination controls work as expected.

To reproduce with PatternFly's table demo, simply add the div below to create some height above the toolbar.

Modified table demo
Screenshot 2024-06-03 at 1 05 27 PM

Sandbox
https://codesandbox.io/p/sandbox/toolbar-scroll-issue-forked-9sn9yf?file=%2Findex.html

Steps

  1. Click on the pagination page selector and choose "100 per page".
  2. Click on the pagination page selector or the bulk select. You may need to click the control more than once.
  3. The page will scroll so the control's menu is out of view.

Cost Management

pagination scrolling

@dlabrecq dlabrecq added the bug label Jun 3, 2024
@github-project-automation github-project-automation bot moved this to Needs triage in PatternFly Issues Jun 3, 2024
@dlabrecq dlabrecq changed the title Bug - Toolbar - controls are scroll page Bug - Toolbar - clicking controls scroll page Jun 3, 2024
@dlabrecq dlabrecq changed the title Bug - Toolbar - clicking controls scroll page Bug - Toolbar - page scrolls when controls are clicked Jun 3, 2024
@adamviktora
Copy link
Contributor

adamviktora commented Jun 4, 2024

I did play around with this and it seems like the issue is caused by setting position: relative; in CSS in .pf-v5-c-toolbar and .pf-v5-c-toolbar__content classes.

@tlabaj tlabaj moved this from Needs triage to On deck in PatternFly Issues Jun 4, 2024
@tlabaj tlabaj added this to the 2024.Q2 milestone Jun 4, 2024
@nicolethoen nicolethoen moved this from On deck to Not started in PatternFly Issues Jun 4, 2024
@mattnolting
Copy link
Contributor

I suspect popper applying position: absolute where pf-menu isn't present in the DOM scrolls the page. Let's try hiding the menu instead of removing it!

@thatblindgeye
Copy link
Contributor

@dlabrecq I noted in my draft PR, but so far one solution that could be handled on our end ends up re-introducing a visual bug (the Dropdown menu flickers when rendering).

A (possibly, depending on the number of instances there are) quick solution would be from the consumer side, updating the Dropdown/Select being used in this sort of scenario to pass in popperProps={{appendTo: () => document.body}}. Would this at all be a viable workaround for now?

@dlabrecq
Copy link
Member Author

@thatblindgeye I don't believe that solution will work for us. Considering the page selector is output by Pagination, we don't appear to have access to the underlying component.

@kmcfaul kmcfaul closed this as completed Jul 16, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in PatternFly Issues Jul 16, 2024
@dlabrecq dlabrecq changed the title Bug - Toolbar - page scrolls when controls are clicked Bug - Pagination - page scrolls when controls are clicked Jul 26, 2024
@dlabrecq dlabrecq changed the title Bug - Pagination - page scrolls when controls are clicked Bug - Toolbar - page scrolls when controls are clicked Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment