google / accompanist

A collection of extension libraries for Jetpack Compose
https://google.github.io/accompanist
Apache License 2.0
7.43k stars 598 forks source link

[Pager] Pager adjusts its size to page height only when switching forward #1453

Closed MaximZI-droid closed 1 year ago

MaximZI-droid commented 1 year ago

Description When using a pager with two pages, the left page adjusts to the height of the right page, while the left page does not adjusts to the right page and has the height of its content.

Steps to reproduce

  1. Download the attached project, open and run it in Android Studio
  2. On the Left page click 3 times on the "click me" button, scrolling as necessary
  3. Switch to the Right tab
  4. Notice that Pager has adjusted its height to the height of the Right page
  5. While on the Right tab, press the "click me" button 6 times, scrolling as necessary
  6. Switch to the Left tab

Observed behavior Pager does not adjust its height to the size of the Left page and instead stays at the height of the Right page

Expected behavior Pager adjusts its height to the size of the page it has switched to.

Additional context Exapmle app with short video https://github.com/ZiMax07/Pager

andkulikov commented 1 year ago

Hello. It is the issue in LazRow - https://issuetracker.google.com/issues/239942263 which was fixed in recent androidx.compose.foundation:foundation:1.4.0-alpha03