Skip to content

Focus trap on Popover scrolls to top, which causes popover below the fold to be hidden #1073

@dgiraldo313

Description

@dgiraldo313

Describe the bug
When the popover is used on a section below the fold and the focusTrap is set to true, on open the page scroll is removed (I think) which causes the page to go all the way to the top. As a result, the popover

Affected project(s) (e.g. pcln-design-system, pcln-modal, etc.)

  • pcln-popover

To Reproduce
Steps to reproduce the behavior:

  1. Go to the Popover storybook and add a story with the popover trigger placed below the fold
  2. Make sure that trapFocus is set to true
  3. Click on the trigger link to open the popover
  4. You should see page scrolled to the top and the popover content out of view

Expected behavior
When using the focus trap we should see focus delegation limited to the content inside the popover, however this should not come at the expense of removing the page scroll.

Screenshots
image
image
After clicking on the popover trigger, the page is scrolled to the top and the Popover content is not visible
image
The popover content can then be found by scrolling to the position

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions