Skip to content

Commit ac19d0a

Browse files
committed
calculating option width with css instead of flexbox
1 parent 700bd57 commit ac19d0a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

ui/src/app/components/options/options.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div fxLayout="column" fxLayoutAlign="space-around start" fxLayoutGap="10px">
22
<div *ngFor="let row of options" fxLayout="row" style="width: 100%" fxLayoutGap="10px" fxLayoutAlign="space-between center">
3-
<div *ngFor="let option of row" [fxFlex]="100 / row.length" [ngStyle]="getOptionStyle(option)">
3+
<div *ngFor="let option of row" [ngStyle]="getOptionStyle(option)">
44
<!-- Checkbox -->
55
<div *ngIf="option.type === 'checkbox'"
66
fxLayout="row" fxLayoutAlign="center center" fxFill fxLayoutGap="10px"

ui/src/app/components/options/options.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,11 @@ export class OptionsComponent {
136136
public ref: ChangeDetectorRef
137137
) {}
138138

139-
getOptionStyle (option: Option) {
139+
getOptionStyle (option: Option, row: Option[]) {
140140
let style = option.style || {}
141+
if (!style.width) {
142+
style.width = `${100 / row.length}%`
143+
}
141144
if (option.type === 'button') {
142145
style.width = '100%'
143146
}

0 commit comments

Comments
 (0)