Skip to content

Instantly share code, notes, and snippets.

@MurhafSousli
Created October 31, 2019 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MurhafSousli/9eae8d569572da8d94d0911cd3cb142f to your computer and use it in GitHub Desktop.
Save MurhafSousli/9eae8d569572da8d94d0911cd3cb142f to your computer and use it in GitHub Desktop.
Test ng-scrollbar auto-height with root DOM
Remove `ngStyle` from `.ng-scrollbar-wrapper` in the template
<div class="ng-scrollbar-wrapper" [ngAttr]="state" [ngStyle]="autoHeightStyles">
To
<div class="ng-scrollbar-wrapper" [ngAttr]="state">
ng-scrollbar {
position: relative;
display: block;
width: 100%;
height: 100%;
max-height: 100%;
min-height: 100%;
max-width: 100%;
min-width: 100%;
}
.ng-scrollbar-wrapper {
// comment the following
//height: 100%;
//max-height: 100%;
//min-height: 100%;
//max-width: 100%;
//min-width: 100%;
}
@Component({
selector: 'ng-scrollbar',
// add the following to host element
host: {
'[class.ng-scrollbar]': 'true',
'[style.height]': 'autoHeightStyles?.height',
'[style.width]': 'autoHeightStyles?.width',
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment