angular - How to auto scroll to top for material2 angular2 dialog box? -
i using https://material.angular.io, dialog box (https://material.angular.io/components/dialog/overview). problem when position dialog box using
config = {'width':'200px', 'height':'400px', position: {'top':'150px', 'left':'400px'}}
i notice when click button show dialog box, scrolls way down... there way make when click button show dialog box, stays @ top/scrolls top?
add code in style.css file.
.md-dialog-container { height: 100vh !important; top: 0 !important; position: fixed !important; }
another way:-
you can adjust position of dialog component using updateposition() method of mddialogref. use code in dialog component:-
import { mddialog, mddialogconfig, mddialogref } '@angular/material'; constructor(public dialmodalref: mddialogref<any>) { } changeposition() { this.dialmodalref.updateposition({ top: '50px', left: '50px' }); }
read more here:- https://material.angular.io/components/component/dialog
hope it's work fine.
Comments
Post a Comment