WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
282326
Grid breaks when using auto-fit if the element is also a container
https://bugs.webkit.org/show_bug.cgi?id=282326
Summary
Grid breaks when using auto-fit if the element is also a container
kevin
Reported
2024-10-30 05:36:29 PDT
Created
attachment 473077
[details]
Image with grid inspector on, showing the issue with grid-auto-fit, and comparing it to auto-fill When an element uses Grid's auto-fit and also has a `container-type: size` or `container-type: inline-size`, it breaks the grid. The columns become 0px in width, and it also creates an incorrect number of columns. The following should create columns with a minimum width of 100px, but instead, it creates columns that are 0px in width. .grid-auto-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); container-type: inline-size; } As for the number of columns, it matches how many would be created if using `auto-fill` instead. For example, if `auto-fill` would create 10 columns, `auto-fill` also results in 10 columns (though now 0px in width), even if there are only three children. Both Chromium browsers and Firefox behave as expected, this issue is only in Safari. I've attached an image of the issue, and a live example of the issue can be found here:
https://codepen.io/kevinpowell/pen/yLmjyYp
Attachments
Image with grid inspector on, showing the issue with grid-auto-fit, and comparing it to auto-fill
(156.63 KB, image/png)
2024-10-30 05:36 PDT
,
kevin
no flags
Details
Is it Possible to make in center?
(570.17 KB, patch)
2024-12-02 12:59 PST
,
webexpert.freelancer
webexpert.freelancer: review?
webexpert.freelancer: commit-queue?
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Miriam Suzanne
Comment 1
2024-10-30 09:16:23 PDT
We have also run into this a few times recently. Grid-items are a central use-case for container queries.
Radar WebKit Bug Importer
Comment 2
2024-11-06 04:37:34 PST
<
rdar://problem/139350671
>
webexpert.freelancer
Comment 3
2024-12-02 12:59:03 PST
Created
attachment 473431
[details]
Is it Possible to make in center?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug