Skip to content

Fix grid content size calculation#956

Open
puneetdixit200 wants to merge 3 commits into
DioxusLabs:mainfrom
puneetdixit200:fix-grid-content-size
Open

Fix grid content size calculation#956
puneetdixit200 wants to merge 3 commits into
DioxusLabs:mainfrom
puneetdixit200:fix-grid-content-size

Conversation

@puneetdixit200

Copy link
Copy Markdown

Objective

Fixes #954

Correct CSS Grid content-size computation so it accounts for explicit track extents and the actual content-box-relative position of placed items. This fixes cases where scrollable grid content only reflected one item or a smaller child instead of the full grid track span.

Context

Previously grid item content-size contribution was calculated relative to each item's grid area. That reset the contribution for every row, so stacked auto-placed items all appeared to start at zero. Grid content size also started from zero, so an explicit track larger than its item was ignored.

This change seeds grid content size from the aligned track extents and measures item contribution from the grid content box origin.

Tests

  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test --test hand_written grid_content_size
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test --test hand_written
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test --lib
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test --test xml content_size
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo test --workspace
  • CARGO_HOME=$PWD/.cargo-home CARGO_TARGET_DIR=$PWD/target cargo fmt --all -- --check
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect grid content size computation

1 participant