Skip to content

Commit 7138035

Browse files
committed
main - 2dd269e docs(material/select): prevent select from jumping in custom trigger example (#29746)
1 parent 5c1fe1c commit 7138035

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<span class="hljs-selector-class">.example-additional-selection</span> {
22
<span class="hljs-attribute">opacity</span>: <span class="hljs-number">0.75</span>;
33
<span class="hljs-attribute">font-size</span>: <span class="hljs-number">0.75em</span>;
4+
<span class="hljs-attribute">line-height</span>: <span class="hljs-number">1</span>;
45
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.example-additional-selection {
22
opacity: 0.75;
33
font-size: 0.75em;
4+
line-height: 1;
45
}

fesm2022/material/select.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class SelectCustomTriggerExample {
1919
this.toppingList = ['Extra cheese', 'Mushroom', 'Onion', 'Pepperoni', 'Sausage', 'Tomato'];
2020
}
2121
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: SelectCustomTriggerExample, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
22-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0-next.3", type: SelectCustomTriggerExample, isStandalone: true, selector: "select-custom-trigger-example", ngImport: i0, template: "<mat-form-field>\n <mat-label>Toppings</mat-label>\n <mat-select [formControl]=\"toppings\" multiple>\n <mat-select-trigger>\n {{toppings.value?.[0] || ''}}\n @if ((toppings.value?.length || 0) > 1) {\n <span class=\"example-additional-selection\">\n (+{{(toppings.value?.length || 0) - 1}} {{toppings.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n @for (topping of toppingList; track topping) {\n <mat-option [value]=\"topping\">{{topping}}</mat-option>\n}\n </mat-select>\n</mat-form-field>\n", styles: [".example-additional-selection {\n opacity: 0.75;\n font-size: 0.75em;\n}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
22+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0-next.3", type: SelectCustomTriggerExample, isStandalone: true, selector: "select-custom-trigger-example", ngImport: i0, template: "<mat-form-field>\n <mat-label>Toppings</mat-label>\n <mat-select [formControl]=\"toppings\" multiple>\n <mat-select-trigger>\n {{toppings.value?.[0] || ''}}\n @if ((toppings.value?.length || 0) > 1) {\n <span class=\"example-additional-selection\">\n (+{{(toppings.value?.length || 0) - 1}} {{toppings.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n @for (topping of toppingList; track topping) {\n <mat-option [value]=\"topping\">{{topping}}</mat-option>\n}\n </mat-select>\n</mat-form-field>\n", styles: [".example-additional-selection {\n opacity: 0.75;\n font-size: 0.75em;\n line-height: 1;\n}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
2323
}
2424
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.3", ngImport: i0, type: SelectCustomTriggerExample, decorators: [{
2525
type: Component,
26-
args: [{ selector: 'select-custom-trigger-example', standalone: true, imports: [MatFormFieldModule, MatSelectModule, FormsModule, ReactiveFormsModule], template: "<mat-form-field>\n <mat-label>Toppings</mat-label>\n <mat-select [formControl]=\"toppings\" multiple>\n <mat-select-trigger>\n {{toppings.value?.[0] || ''}}\n @if ((toppings.value?.length || 0) > 1) {\n <span class=\"example-additional-selection\">\n (+{{(toppings.value?.length || 0) - 1}} {{toppings.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n @for (topping of toppingList; track topping) {\n <mat-option [value]=\"topping\">{{topping}}</mat-option>\n}\n </mat-select>\n</mat-form-field>\n", styles: [".example-additional-selection {\n opacity: 0.75;\n font-size: 0.75em;\n}\n"] }]
26+
args: [{ selector: 'select-custom-trigger-example', standalone: true, imports: [MatFormFieldModule, MatSelectModule, FormsModule, ReactiveFormsModule], template: "<mat-form-field>\n <mat-label>Toppings</mat-label>\n <mat-select [formControl]=\"toppings\" multiple>\n <mat-select-trigger>\n {{toppings.value?.[0] || ''}}\n @if ((toppings.value?.length || 0) > 1) {\n <span class=\"example-additional-selection\">\n (+{{(toppings.value?.length || 0) - 1}} {{toppings.value?.length === 2 ? 'other' : 'others'}})\n </span>\n }\n </mat-select-trigger>\n @for (topping of toppingList; track topping) {\n <mat-option [value]=\"topping\">{{topping}}</mat-option>\n}\n </mat-select>\n</mat-form-field>\n", styles: [".example-additional-selection {\n opacity: 0.75;\n font-size: 0.75em;\n line-height: 1;\n}\n"] }]
2727
}] });
2828

2929
/** @title Disabled select */

fesm2022/material/select.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/components-examples",
3-
"version": "19.0.0-next.4+sha-234e5e0",
3+
"version": "19.0.0-next.4+sha-2dd269e",
44
"description": "Angular Components Examples",
55
"private": true,
66
"repository": {
@@ -255,15 +255,15 @@
255255
},
256256
"homepage": "https://github.com/angular/components#readme",
257257
"peerDependencies": {
258-
"@angular/cdk": "19.0.0-next.4+sha-234e5e0",
259-
"@angular/cdk-experimental": "19.0.0-next.4+sha-234e5e0",
258+
"@angular/cdk": "19.0.0-next.4+sha-2dd269e",
259+
"@angular/cdk-experimental": "19.0.0-next.4+sha-2dd269e",
260260
"@angular/core": "^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0",
261261
"@angular/common": "^19.0.0-0 || ^19.1.0-0 || ^19.2.0-0 || ^19.3.0-0 || ^20.0.0-0",
262-
"@angular/material": "19.0.0-next.4+sha-234e5e0",
263-
"@angular/material-experimental": "19.0.0-next.4+sha-234e5e0",
264-
"@angular/material-moment-adapter": "19.0.0-next.4+sha-234e5e0",
265-
"@angular/material-luxon-adapter": "19.0.0-next.4+sha-234e5e0",
266-
"@angular/material-date-fns-adapter": "19.0.0-next.4+sha-234e5e0"
262+
"@angular/material": "19.0.0-next.4+sha-2dd269e",
263+
"@angular/material-experimental": "19.0.0-next.4+sha-2dd269e",
264+
"@angular/material-moment-adapter": "19.0.0-next.4+sha-2dd269e",
265+
"@angular/material-luxon-adapter": "19.0.0-next.4+sha-2dd269e",
266+
"@angular/material-date-fns-adapter": "19.0.0-next.4+sha-2dd269e"
267267
},
268268
"dependencies": {
269269
"tslib": "^2.3.0"

0 commit comments

Comments
 (0)