-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(cdk): fix scroll blocker for custom withScroll
mode
#1364
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1364 +/- ##
==========================================
- Coverage 81.17% 81.11% -0.06%
==========================================
Files 232 232
Lines 7049 7054 +5
Branches 598 599 +1
==========================================
Hits 5722 5722
- Misses 1151 1156 +5
Partials 176 176
|
@@ -442,8 +442,22 @@ export class NbLayoutComponent implements AfterViewInit, OnDestroy { | |||
.pipe( | |||
filter(() => this.withScrollValue), | |||
) | |||
.subscribe((scrollable: boolean) => { | |||
.subscribe((scrollable) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's return type declaration here:
.subscribe((scrollable) => { | |
.subscribe((scrollable: boolean) => { |
* so that it won't add additional positioning. | ||
*/ | ||
if (!scrollable) { | ||
root.classList.add(scrollBlockClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use renderer here:
root.classList.add(scrollBlockClass); | |
this.renderer.addClass(root, scrollBlockClass); |
if (!scrollable) { | ||
root.classList.add(scrollBlockClass); | ||
} else { | ||
root.classList.remove(scrollBlockClass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use renderer here:
root.classList.remove(scrollBlockClass); | |
this.renderer.removeClass(root, scrollBlockClass); |
* we need to disable default CDK scroll blocker (@link NbBlockScrollStrategyAdapter) on HTML element | ||
* so that it won't add additional positioning. | ||
*/ | ||
.nebular-global-scrollblock { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it has to be:
.nebular-global-scrollblock { | |
.nb-global-scrollblock { |
Closes #1158, Closes #1259