Skip to content

Popover.Pane doesn't handle onScrolledToBottom properly #3607

@anasyusef

Description

@anasyusef

Issue summary

Popover.Pane component doesn't handle the onScrolledToBottom event properly on some screens.

Digging further into this problem. I noticed that Popover.Pane can be composed of the Scrollable component and that component has a handleScroll handler where it checks if it has scrolled to the bottom (const hasScrolledToBottom = scrollHeight - scrollTop === clientHeight;)

This condition doesn't become true thus not triggering the event due to scrollHeight - scrollTop coming very close but not equal to clientHeight. When I tested it, scrollHeight - scrollTop = 295.2 and clientHeight = 295

Expected behavior

ezgif-com-gif-maker

Actual behavior

ezgif-com-gif-maker-1

Steps to reproduce the problem

The code is taken from the official Polaris example on 'Popover with lazy loaded list'
It works on certain screens. Not really sure what is the root cause.

I tried it on the following screens:

1600 x 900 (Works)
2560 x 1440 (Doesn't work)
1920 x 1080 (Doesn't work)

Reduced test case

https://codesandbox.io/s/incsl?module=App.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken and not working as intended in the system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions