Skip to content

If the size of item is 0, EstimateSize will be used as a fallback. #207

Closed
@baco16g

Description

@baco16g

Describe

  • Consider a pattern in which an item component does not render content under certain conditions.
    • For example, in a list that renders only text, an empty string height is 0.
  • In the short circuit evaluation below, EstimateSize is used as the offset value, even if I purposely set the size to 0.

for (let index = 0; index < givenIndex; index++) {
// this.__getIndexOffsetCalls++
indexSize = this.sizes.get(this.param.uniqueIds[index])
offset = offset + (indexSize || this.getEstimateSize())
}

To Reproduce

Steps to reproduce the behavior:

  1. Scroll down to index 10. Although it is a buffer value, range does not change.
  2. Scroll down to index 14. The range has finally changed, but the padFront value seems to be incorrect.

Reproduce demo

Other

  • Version 2.2.0
  • Browser chrome, safari

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions