Skip to content

fix(module:modal,drawer): secondary overlays not scrolling inside#8804

Merged
Laffery merged 26 commits into
NG-ZORRO:masterfrom
ParsaArvanehPA:feature/fix-secondary-overlays-not-moving-while-scrolling-inside-drawer-or-modal-components
Oct 5, 2024
Merged

fix(module:modal,drawer): secondary overlays not scrolling inside#8804
Laffery merged 26 commits into
NG-ZORRO:masterfrom
ParsaArvanehPA:feature/fix-secondary-overlays-not-moving-while-scrolling-inside-drawer-or-modal-components

Conversation

@ParsaArvanehPA

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Currently, when a component, such as the select component, is created using the CDK Overlay within another component that also utilizes CDK Overlay (like a modal or drawer), there is an issue with the positioning during scrolling. Specifically, the first component's position remains fixed and does not adjust to its parent. This behavior occurs because the CDK Overlay, by default, listens for scroll events on the window, which prevents the 'ConnectedPositionStrategy' from detecting changes in position effectively.

To address this issue, we simply need to configure the CDK to listen for scroll events not on the window, but on the secondary overlay. This can be accomplished by using the cdkScrollable directive.

Issue Number: #7430, #7695, #7865, #8799, #7528, #7528, #7003

What is the new behavior?

fixed the issue mentioned above.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@codecov

codecov Bot commented Sep 28, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.76%. Comparing base (099964c) to head (7a8e100).
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8804      +/-   ##
==========================================
- Coverage   91.77%   91.76%   -0.01%     
==========================================
  Files         536      536              
  Lines       18455    18455              
  Branches     2816     2816              
==========================================
- Hits        16937    16936       -1     
  Misses       1209     1209              
- Partials      309      310       +1     
Flag Coverage Δ
91.76% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HyperLife1119 HyperLife1119 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment