Skip to content

Non-fastpath grid measure incorrectly measures children #432

Closed

Description

@carldebilly

Bug Report

This bug is the root cause of another one: #410.

When the Grid panel is measuring its children, it will check if it can use only one dimension to layout its children. This is called the fastpath. When there's both more than one columns and more than one row, this fastpath mecanism can't be used.

Current behavior

The non-fastpath will simply invoke the horizontal measure followed by the vertical measure. During the horizontal measure, the vertical size is simply the size of the control and same behavior for vertical measurement. The problem is happening there: since the VirtualizingPanelLayout will use the available vertical measurement to generate its items, it can generate too much items because the size is larger than the real one. During the second measure (or during the arrange phase), the right vertical measurement will be passed, causing the virtualizing panel to remove items... because too much has been generated.

Expected behavior

The availableSize used to measure children of a Grid panel should always represent the actual available size.

Minimal reproduction of the problem with instructions

Expected behavior is coded in this test: 394be74#diff-649b70570e5cb6ca2be79932ec29ef8dR235

Simply remove the [Ignore] attribute and run the test.

Environment

Nuget Package: 

Package Version(s): 

Affected platform(s):
- [~] iOS (this bug is present on iOS, but doesn't affect the virtualizing)
- [~] Android (this bug is present on Android, but doesn't affect the virtualizing)
- [X] WebAssembly
- [ ] Windows
- [ ] Build tasks

Activity

  1. added
    kind/bug
    on Dec 13, 2018
  2. added
    platform/android 🤖
    platform/ios 🍎
    platform/wasm 🌐
    on May 22, 2019
  3. modified the milestone: 3.1 on Aug 29, 2020
  4. added
    project/layout 🧱
    and removed on Sep 21, 2020
  5. added
    area/grid
    on Oct 8, 2020
  6. added
    difficulty/tbd
    on Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/griddifficulty/tbdkind/bugplatform/android 🤖platform/ios 🍎platform/wasm 🌐project/layout 🧱

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions