bug(cdkMenu): cdkMenu is scrolled down when max-height is set
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
When using max-height on cdkMenu with overflow-y: auto, menu is scrolled down a bit when first shown.
Bad:

Good:

### Reproduction
StackBlitz link: https://stackblitz.com/edit/gbirs4?file=src/example/cdk-menu-standalone-menu-example.html,src/example/cdk-menu-standalone-menu-example.css
Steps to reproduce:
1. Add cdk menu with options with at least one cdkMenuHeaderItem.
2. Set max-height on cdkMenu.
3. Open menu.
### Expected Behavior
Menu should not be scrolled at all.
### Actual Behavior
Menu is scrolled a bit down.
### Environment
- Angular: 18.2.2
- CDK/Material: 18.2.2
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS
コントリビューションガイド
調査の方向性
StackBlitz の例を使用して問題を再現します。まず src/example/cdk-menu-standalone-menu-example.html と src/example/cdk-menu-standalone-menu-example.css から始めてください。cdkMenu に cdkMenuHeaderItem と max-height、および overflow-y: auto を設定して確認します。メニューが初期スクロールオフセットなしで開けば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100