Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fd-panel-grid class not properly updated after changing col attribute #864

Closed
adamko147 opened this issue Jun 5, 2019 · 2 comments
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@adamko147
Copy link

adamko147 commented Jun 5, 2019

Is this a bug, enhancement, or feature request?

Bug

Briefly describe your proposal.

fd-panel-grid class value is not properly updated after changing [col] attribute

Which versions of Angular and Fundamental NGX are affected? (If this is a feature request, use current version.)

Angular 7.2.0
fiori-fundamentals: 1.5.7
fundamental-ngx: 0.5.1
using SCSS

If this is a bug, please provide steps for reproducing it.

fd-panel-grid with 4 columns, content in one column has "Hide" button.

when page is loaded

<fd-panel-grid class="fd-panel-grid--4col fd-panel-grid--nogap fd-panel-grid" ng-reflect-col="4" ng-reflect-nogap="true">

is generated. When clicking Hide button, change in the [col] property causes the grid is updated as

<fd-panel-grid class="fd-panel-grid--3col" ng-reflect-col="3" ng-reflect-nogap="true">

The updated class is missing fd-panel-grid--nogap fd-panel-grid classes so content of the grid is not properly organised (cols stack vertically instead of horizontally).

Please provide relevant source code if applicable.

  • test.component.html
<fd-panel-grid [nogap]="true" [col]="col">
    <fd-panel *ngIf="showFirst">
        <button fd-button (click)="showFirst = false">Hide</button>
    </fd-panel>
    <fd-panel>Col 2</fd-panel>
    <fd-panel>Col 3</fd-panel>
    <fd-panel>Col 4</fd-panel>
</fd-panel-grid>
  • test.component.ts
@Component({
    selector: 'app-test',
    templateUrl: './test.component.html',
    styleUrls: ['./test.component.scss']
})
export class TestComponent {
    showFirst: boolean = true;
    get col() {
        return this.showFirst ? 4: 3
    }
    constructor() { }
}
  • test.component.scss
// empty

Is there anything else we should know?

setting style

<fd-panel-grid class="fd-panel-grid--nogap fd-panel-grid"> ... </fd-panel-grid>

solves the problem, however it's workaround.

@MattL75 MattL75 added bug Something isn't working good first issue Good for newcomers labels Jun 5, 2019
@adamko147
Copy link
Author

adamko147 commented Jun 10, 2019

Can be caused by removing all classes in AbstractFdNgxClass.ngOnChanges https://github.com/SAP/fundamental-ngx/blob/master/library/src/lib/utils/abstract-fd-ngx-class.ts#L44 ?

@MattL75
Copy link
Contributor

MattL75 commented Jun 19, 2019

This should be fixed by @JKMarkowski's PR #881

@MattL75 MattL75 closed this as completed Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants