mazdik / ng-modal

Angular resizable and draggable modal component
https://mazdik.github.io/ng-modal/
82 stars 43 forks source link

Footer Buttons move outside ui-modal after resizing #11

Open fupps opened 4 years ago

fupps commented 4 years ago

Hi, I try to use your modal lib and I'am doing something wrong....

I have created a simple component with your html and css from the readme.md . In this component i use this to get the modal and show it:

@ViewChild(ModalComponent) modal: ModalComponent;
  show(): void {
    this.modal.show();
  }

In the app component's html i have inserted:

<app-mysimple></app-mysimple>
 <button (click)="openDialog()">Knoten</button>

and in the ts

 @ViewChild(MySimpleComponent) simple:   MySimpleComponent;
openDialog() {
    this.simple.show();
  }

The Button opens the modal dialog and everything is fine: image

When I maximize the modal the maximize/normalize button does not change: image

When I normalize again the buttons start moving: image

After 3 times maximize/normalize: image

Do you have any hints what I am doing wrong? Best regrads Sebastian

PS: Using Angular

"dependencies": { "@angular/animations": "~9.0.6", "@angular/cdk": "^9.1.3", "@angular/common": "~9.0.6", "@angular/compiler": "~9.0.6", "@angular/core": "~9.0.6", "@angular/forms": "~9.0.6", "@angular/material": "^9.1.3", "@angular/platform-browser": "~9.0.6", "@angular/platform-browser-dynamic": "~9.0.6", "@angular/router": "~9.0.6", "ng-modal-lib": "0.0.4", "ol": "^6.2.1", "rxjs": "~6.5.4", "tslib": "^1.10.0", "zone.js": "~0.10.2" },

mazdik commented 4 years ago

Must look in css. I could not reproduce this. Look through the developer tools in chrome F12 I recommend adding normalize.css

fupps commented 4 years ago

Located my problem:

*, *:before, *:after {
  box-sizing: border-box;
}

If this is missing in the .\src\styles.css (.scss) it does not work as expected. But as I am not very skilled with css I don't know why... Maybe you could include that somehow in the lib to make more robust?

Thanks a lot for that nice lib.

mazdik commented 4 years ago

added in the version 0.0.5