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

fix(cdk): fix scroll blocker for custom withScroll mode #1364

Merged
merged 3 commits into from
Apr 10, 2019

Conversation

nnixaa
Copy link
Collaborator

@nnixaa nnixaa commented Apr 8, 2019

Closes #1158, Closes #1259

@nnixaa nnixaa requested a review from Tibing April 8, 2019 16:33
@codecov
Copy link

codecov bot commented Apr 8, 2019

Codecov Report

Merging #1364 into master will decrease coverage by 0.05%.
The diff coverage is 0%.

@@            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
Impacted Files Coverage Δ
...mework/theme/components/layout/layout.component.ts 74.01% <0%> (-2.16%) ⬇️

@@ -442,8 +442,22 @@ export class NbLayoutComponent implements AfterViewInit, OnDestroy {
.pipe(
filter(() => this.withScrollValue),
)
.subscribe((scrollable: boolean) => {
.subscribe((scrollable) => {
Copy link
Member

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:

Suggested change
.subscribe((scrollable) => {
.subscribe((scrollable: boolean) => {

* so that it won't add additional positioning.
*/
if (!scrollable) {
root.classList.add(scrollBlockClass);
Copy link
Member

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:

Suggested change
root.classList.add(scrollBlockClass);
this.renderer.addClass(root, scrollBlockClass);

if (!scrollable) {
root.classList.add(scrollBlockClass);
} else {
root.classList.remove(scrollBlockClass);
Copy link
Member

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:

Suggested change
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 {
Copy link
Member

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:

Suggested change
.nebular-global-scrollblock {
.nb-global-scrollblock {

@nnixaa nnixaa merged commit 34193cc into master Apr 10, 2019
@nnixaa nnixaa deleted the fix/overlay-scroll branch April 10, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants