Skip to content

[labs/virtualizer] Calculates size incorrectly when a scrolling ancestor has padding #3400

Closed

Description

@usergenic

Which package(s) are affected?

Virtualizer (@lit-labs/virtualizer)

Description

Gray already figured out the fix for this. Just adding to an issue to get this added to sprint plan...

image

Reproduction

This demos the issue with an 80px padding for the element containing the virtualizer
https://lit.dev/playground/#gist=3f55b065eb257cbaf21b1168cbb65093

Workaround

n/a

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

masonry preview and 0.7.2

Browser/OS/Node environment

n/a

Activity

  1. moved this to 📋 Triaged in Lit Project Boardon Oct 27, 2022
  2. self-assigned this
    on Oct 27, 2022
  3. usergenic commented on Nov 1, 2022

    @usergenic
    ContributorAuthor

    Here's the example with no padding in the container:
    Screen Shot 2022-11-01 at 10 45 20 AM

    Here's the example with padding added to the container, see how it's all shifted over instead of padded from both sides:
    Screen Shot 2022-11-01 at 10 45 46 AM

    Here's the example with the suggested fix, but at this width it only fits one column:
    Screen Shot 2022-11-01 at 10 46 08 AM

    But what is more an issue is that virtualizer goes into some kind of update loop which both kills performance and never seems to resolve:
    https://user-images.githubusercontent.com/578/199290160-94a81441-68ab-4eb6-923a-159d19be556c.mov

  4. usergenic commented on Nov 4, 2022

    @usergenic
    ContributorAuthor

    Fixed in #005c68f

  5. Repository owner moved this from 📋 Triaged to ✅ Done in Lit Project Boardon Nov 4, 2022
  6. added a commit that references this issue on Nov 30, 2022
  7. changed the title [-][labs/virtualizer] Virtualizer in a padded container stubbornly asserts size ignoring padding.[/-] [+][labs/virtualizer] Calculates size incorrectly when a scrolling ancestor has non-zero padding[/+] on Dec 9, 2022
  8. changed the title [-][labs/virtualizer] Calculates size incorrectly when a scrolling ancestor has non-zero padding[/-] [+][labs/virtualizer] Calculates size incorrectly when a scrolling ancestor has padding[/+] on Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions