angular / angular/components

feat(Menu): Option to have it the same width as the trigger

オープン
#30,862 コメント 0 件 リアクション 3 件 担当者 0 名 GitHub で見る
area: cdk/menu feature P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### Feature Description

A possibility to have the https://material.angular.io/cdk/menu/overview take over the width of the container that triggers it.
As an example the grey area should span the full width of the red in the following example:

Image

Currently it seems that you have to provide a fixed width in px. Otherwise it does not work. But you don't always know the exact with of the 'trigger'.

There's an example here: https://vbqdncww.stackblitz.io

In [issue 26336](https://github.com/angular/components/issues/26336) it seems that they are overriding MAT_SELECT_CONFIG to set a `min-width: min-content;`, but have not gotten that to work yet.

### Use Case

It would enable a more consistent styling.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Angular CDK menu の概要と StackBlitz の例から始めて、現在のサイズ動作を再現します。issue 26336 には、メニュー幅の設定に関する関連コンテキストがあります。メニューが固定ピクセル幅を必要とせずにトリガーコンテナーの幅を使用でき、その動作が適切な例またはテストで実証されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。