|
10 | 10 |
|
11 | 11 | <mat-menu #menu="matMenu">
|
12 | 12 | @for (item of items; track item) {
|
13 |
| - <button mat-menu-item (click)="select(item.text)" [disabled]="item.disabled"> |
| 13 | + <button |
| 14 | + mat-menu-item |
| 15 | + (click)="select(item.text)" |
| 16 | + [disabled]="item.disabled" |
| 17 | + [disabledInteractive]="disabledInteractive" |
| 18 | + [matTooltip]="item.tooltipText"> |
14 | 19 | {{ item.text }}
|
15 | 20 | </button>
|
16 | 21 | }
|
|
27 | 32 |
|
28 | 33 | <mat-menu #divider="matMenu">
|
29 | 34 | @for (item of items; track item) {
|
30 |
| - <button mat-menu-item [disabled]="item.disabled">{{ item.text }}</button> |
| 35 | + <button |
| 36 | + mat-menu-item |
| 37 | + [disabled]="item.disabled" |
| 38 | + [disabledInteractive]="disabledInteractive"> |
| 39 | + {{ item.text }} |
| 40 | + </button> |
31 | 41 | @if (!$last) {
|
32 | 42 | <mat-divider></mat-divider>
|
33 | 43 | }
|
|
98 | 108 |
|
99 | 109 | <mat-menu #anchorMenu="matMenu">
|
100 | 110 | @for (item of items; track item) {
|
101 |
| - <a mat-menu-item href="https://www.google.com" [disabled]="item.disabled"> |
| 111 | + <a |
| 112 | + mat-menu-item |
| 113 | + href="https://www.google.com" |
| 114 | + [disabled]="item.disabled" |
| 115 | + [disabledInteractive]="disabledInteractive"> |
102 | 116 | {{ item.text }}
|
103 | 117 | </a>
|
104 | 118 | }
|
105 | 119 | </mat-menu>
|
106 | 120 | </div>
|
107 | 121 | <div class="demo-menu-section">
|
108 |
| - <p> |
109 |
| - Position x: before |
110 |
| - </p> |
| 122 | + <p>Position x: before</p> |
111 | 123 | <mat-toolbar class="demo-end-icon">
|
112 | 124 | <button matIconButton [matMenuTriggerFor]="posXMenu" aria-label="Open x-positioned menu">
|
113 | 125 | <mat-icon>more_vert</mat-icon>
|
|
116 | 128 |
|
117 | 129 | <mat-menu xPosition="before" #posXMenu="matMenu">
|
118 | 130 | @for (item of iconItems; track item) {
|
119 |
| - <button mat-menu-item [disabled]="item.disabled"> |
| 131 | + <button |
| 132 | + mat-menu-item |
| 133 | + [disabled]="item.disabled" |
| 134 | + [disabledInteractive]="disabledInteractive"> |
120 | 135 | <mat-icon>{{ item.icon }}</mat-icon>
|
121 | 136 | {{ item.text }}
|
122 | 137 | </button>
|
123 | 138 | }
|
124 | 139 | </mat-menu>
|
125 | 140 | </div>
|
126 | 141 | <div class="demo-menu-section">
|
127 |
| - <p> |
128 |
| - Position y: above |
129 |
| - </p> |
| 142 | + <p>Position y: above</p> |
130 | 143 | <mat-toolbar>
|
131 | 144 | <button matIconButton [matMenuTriggerFor]="posYMenu" aria-label="Open y-positioned menu">
|
132 | 145 | <mat-icon>more_vert</mat-icon>
|
|
135 | 148 |
|
136 | 149 | <mat-menu yPosition="above" #posYMenu="matMenu">
|
137 | 150 | @for (item of items; track item) {
|
138 |
| - <button mat-menu-item [disabled]="item.disabled">{{ item.text }}</button> |
| 151 | + <button |
| 152 | + mat-menu-item |
| 153 | + [disabled]="item.disabled" |
| 154 | + [disabledInteractive]="disabledInteractive"> |
| 155 | + {{ item.text }} |
| 156 | + </button> |
139 | 157 | }
|
140 | 158 | </mat-menu>
|
141 | 159 | </div>
|
|
153 | 171 |
|
154 | 172 | <mat-menu [overlapTrigger]="true" #menuOverlay="matMenu">
|
155 | 173 | @for (item of items; track item) {
|
156 |
| - <button mat-menu-item [disabled]="item.disabled">{{ item.text }}</button> |
| 174 | + <button |
| 175 | + mat-menu-item |
| 176 | + [disabled]="item.disabled" |
| 177 | + [disabledInteractive]="disabledInteractive"> |
| 178 | + {{ item.text }} |
| 179 | + </button> |
157 | 180 | }
|
158 | 181 | </mat-menu>
|
159 | 182 | </div>
|
160 | 183 | <div class="demo-menu-section">
|
161 |
| - <p> |
162 |
| - Position x: before, overlapTrigger: true |
163 |
| - </p> |
| 184 | + <p>Position x: before, overlapTrigger: true</p> |
164 | 185 | <mat-toolbar class="demo-end-icon">
|
165 | 186 | <button matIconButton [mat-menu-trigger-for]="posXMenuOverlay">
|
166 | 187 | <mat-icon>more_vert</mat-icon>
|
|
169 | 190 |
|
170 | 191 | <mat-menu xPosition="before" [overlapTrigger]="true" #posXMenuOverlay="matMenu">
|
171 | 192 | @for (item of iconItems; track item) {
|
172 |
| - <button mat-menu-item [disabled]="item.disabled"> |
| 193 | + <button |
| 194 | + mat-menu-item |
| 195 | + [disabled]="item.disabled" |
| 196 | + [disabledInteractive]="disabledInteractive"> |
173 | 197 | <mat-icon>{{ item.icon }}</mat-icon>
|
174 | 198 | {{ item.text }}
|
175 | 199 | </button>
|
176 | 200 | }
|
177 | 201 | </mat-menu>
|
178 | 202 | </div>
|
179 | 203 | <div class="demo-menu-section">
|
180 |
| - <p> |
181 |
| - Position y: above, overlapTrigger: true |
182 |
| - </p> |
| 204 | + <p>Position y: above, overlapTrigger: true</p> |
183 | 205 | <mat-toolbar>
|
184 | 206 | <button matIconButton [mat-menu-trigger-for]="posYMenuOverlay">
|
185 | 207 | <mat-icon>more_vert</mat-icon>
|
|
188 | 210 |
|
189 | 211 | <mat-menu yPosition="above" [overlapTrigger]="true" #posYMenuOverlay="matMenu">
|
190 | 212 | @for (item of items; track item) {
|
191 |
| - <button mat-menu-item [disabled]="item.disabled">{{ item.text }}</button> |
| 213 | + <button |
| 214 | + mat-menu-item |
| 215 | + [disabled]="item.disabled" |
| 216 | + [disabledInteractive]="disabledInteractive"> |
| 217 | + {{ item.text }} |
| 218 | + </button> |
192 | 219 | }
|
193 | 220 | </mat-menu>
|
194 | 221 | </div>
|
195 | 222 | </div>
|
| 223 | +<div> |
| 224 | + <mat-checkbox [(ngModel)]="disabledInteractive">Disabled interactive</mat-checkbox> |
| 225 | +</div> |
196 | 226 |
|
197 | 227 | <div style="height: 500px">This div is for testing scrolled menus.</div>
|
0 commit comments