mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
fix(grid): set the flex and width to auto when size is auto
fixes #14807
This commit is contained in:
@ -192,9 +192,11 @@ export class Col {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const colSize = SUPPORTS_VARS
|
// If the size is set to auto then don't calculate a size
|
||||||
|
const colSize = (columns === 'auto')
|
||||||
|
? 'auto'
|
||||||
// If CSS supports variables we should use the grid columns var
|
// If CSS supports variables we should use the grid columns var
|
||||||
? `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`
|
: SUPPORTS_VARS ? `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`
|
||||||
// Convert the columns to a percentage by dividing by the total number
|
// Convert the columns to a percentage by dividing by the total number
|
||||||
// of columns (12) and then multiplying by 100
|
// of columns (12) and then multiplying by 100
|
||||||
: ((columns / 12) * 100) + '%';
|
: ((columns / 12) * 100) + '%';
|
||||||
|
|||||||
@ -50,6 +50,32 @@
|
|||||||
</ion-row>
|
</ion-row>
|
||||||
</ion-grid>
|
</ion-grid>
|
||||||
|
|
||||||
|
<h2 padding-start>Size auto</h2>
|
||||||
|
<ion-grid>
|
||||||
|
<ion-row>
|
||||||
|
<ion-col>
|
||||||
|
<div>
|
||||||
|
ion-col
|
||||||
|
</div>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col size="auto">
|
||||||
|
<div>
|
||||||
|
ion-col with extra text to make it auto
|
||||||
|
</div>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col>
|
||||||
|
<div>
|
||||||
|
ion-col
|
||||||
|
</div>
|
||||||
|
</ion-col>
|
||||||
|
<ion-col>
|
||||||
|
<div>
|
||||||
|
ion-col
|
||||||
|
</div>
|
||||||
|
</ion-col>
|
||||||
|
</ion-row>
|
||||||
|
</ion-grid>
|
||||||
|
|
||||||
<h2 padding-start>Breakpoint Sizes</h2>
|
<h2 padding-start>Breakpoint Sizes</h2>
|
||||||
<ion-grid>
|
<ion-grid>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
|
|||||||
Reference in New Issue
Block a user