Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
eb7ee2b
fix(material/chips): chips form control updating value immediately
mistrykaran91 Mar 28, 2025
21cf14a
build: update `angular-linking` to attempt fix postinstall flakiness …
devversion Mar 24, 2025
7098e66
fix(material/sort): set cursor on entire clickable area (#30696)
crisbeto Mar 24, 2025
d786b43
build: migrate theming tests to `rules_js`
devversion Mar 20, 2025
04badba
build: migrate more targets to `ts_project`
devversion Mar 20, 2025
052ebc1
build: include `src/cdk` in pnpm workspace
devversion Mar 24, 2025
1d72be8
build: migrate schematics to `ts_project`
devversion Mar 21, 2025
20fd1d9
build: update sync config to reflect internal update (#30707)
devversion Mar 25, 2025
5ceae40
More changes to migrate to `ts_project` (#30704)
devversion Mar 25, 2025
029a7d8
build: update `rules_angular`
devversion Mar 25, 2025
2e83e7e
build: fix incorrect packaging of `theme-color` schematic
devversion Mar 25, 2025
01067bc
build: migrate all `ng_e2e_test_library` targets to `ts_project`
devversion Mar 25, 2025
4f1f9e0
build: remove `ts_library` from `defaults.bzl`
devversion Mar 25, 2025
0147ab2
docs: release notes for the v19.2.7 release
crisbeto Mar 26, 2025
d696717
release: cut the v20.0.0-next.4 release
crisbeto Mar 26, 2025
ccad18f
build: fix husky warnings (#30726)
mmalerba Mar 26, 2025
b353b75
fix(material/form-field): use ResizeObserver for label offset calcula…
mmalerba Mar 27, 2025
d914d97
refactor: rename mdc- prefixed tokens/variables to mat- (#30677)
andrewseguin Mar 27, 2025
ccf0e07
ci: update bazel RBE setup on CI and use trusted build configuration …
josephperrott Mar 27, 2025
17382d3
build: update Node version
crisbeto Mar 27, 2025
a4021f0
build: update to the latest version of Angular
crisbeto Mar 27, 2025
e5ab9c3
build: remove usages of platform-browser-dynamic
crisbeto Mar 27, 2025
1c6883b
build: disable remote upload of local action results to RBE cache (#3…
josephperrott Mar 27, 2025
edfe762
test(cdk/overlay): change how renders are counted in test (#30712)
mmalerba Mar 27, 2025
581e1c3
fix(cdk/overlay): use MutationObserver to detach overlay (#30703)
mmalerba Mar 27, 2025
a869495
refactor(material/snack-bar): switch from afterRender to afterNextRen…
mmalerba Mar 27, 2025
5c92685
build: prepare for new `ng_project` rule and try in `cdk/a11y`
devversion Mar 26, 2025
a838f93
build: update `markdown-to-html` to avoid output conflicts
devversion Mar 26, 2025
deab676
build: migrate all `ng_module` targets to the new `ng_project` rule
devversion Mar 26, 2025
3652993
build: ensure tsconfig is explicitly configured for `ts_project` targets
devversion Mar 27, 2025
a554391
build: remove size testing
devversion Mar 27, 2025
fb01253
build: patch `ng_package` to produce partial output with `ng_project`
devversion Mar 27, 2025
9e578cc
build: remove references to `ng_module` rule
devversion Mar 27, 2025
b362257
refactor: remove internal mdc- vars (#30736)
andrewseguin Mar 28, 2025
aa5aba6
fix(cdk-experimental/popover-edit): use MutationObserver to detect ta…
mmalerba Mar 28, 2025
cdd6938
build: adjust `sass` compiler to work with `rules_js`
devversion Mar 28, 2025
5d006f8
build: update `ts_project` interop to default to `rules_js`
devversion Mar 28, 2025
757abc1
build: remove `interop_deps`
devversion Mar 28, 2025
6afc0f0
fix(material/form-field): move error aria-live to parent container (#…
adolgachev Mar 28, 2025
075c7b7
docs: fix incorrect guide links after recent collision change (#30745)
devversion Mar 28, 2025
1045d72
refactor: remove md_comp files (#30742)
andrewseguin Mar 29, 2025
b22c197
feat(material/core): introduce custom token for controlling animation…
crisbeto Mar 30, 2025
5931c21
fix(multiple): remove backwards-compatibility code (#30747)
crisbeto Mar 31, 2025
d8a3168
fix(material/snack-bar): rename snackbar token prefix (#30750)
andrewseguin Mar 31, 2025
7ad9c1f
refactor: merge m2 mdc and mat tokens (#30748)
andrewseguin Mar 31, 2025
6b1870d
fix(material/checkbox): hardcode token renames (#30752)
andrewseguin Mar 31, 2025
37e3567
perf(cdk/drag-drop): fix performance regression when destroying items…
crisbeto Mar 31, 2025
c76a2ca
fix(cdk-experimental/ui-patterns): add modifier checks for regexps (#…
wagnermaciel Mar 31, 2025
77b0938
refactor(cdk-experimental/ui-patterns): track list selection by value…
wagnermaciel Mar 31, 2025
7cb9ec2
fix(material/slider): fix clobbered token for hover/focus/pressed (#3…
andrewseguin Mar 31, 2025
886b97d
refactor: merge m3 mdc and mat tokens (#30755)
andrewseguin Apr 1, 2025
e9f937e
ci: update to latest dev-infra action versions (#30760)
josephperrott Apr 1, 2025
ce5b853
test(cdk-experimental/ui-patterns): listbox navigation tests (#30767)
wagnermaciel Apr 2, 2025
b195851
build: update angular shared dev-infra code to b3b3466 (#30776)
josephperrott Apr 2, 2025
95dc24d
fix(material/tabs): allow ID to be set on tab (#30768)
crisbeto Apr 2, 2025
bac9897
perf(cdk-experimental/column-resize): improve hover responsiveness of…
danielolaru91 Apr 2, 2025
d343a78
Add a null check to autocomplete options (#30734)
rileyajones Apr 2, 2025
6f3f14f
test: fix broken autocomplete test (#30782)
mmalerba Apr 2, 2025
10a3b94
docs: release notes for the v19.2.8 release
mmalerba Apr 2, 2025
2eaf3ba
release: cut the v20.0.0-next.5 release
mmalerba Apr 2, 2025
4ec2837
build: migrate all `nodejs_binary` targets to `rules_js`
devversion Mar 31, 2025
2164418
build: migrate `nodejs_test` targets to `rules_js`
devversion Mar 31, 2025
d2a2b99
build: add ng_package interop for `rules_js` pnpm linking
devversion Mar 31, 2025
8b2eb8c
build: setup pnpm workspace for first-party packages
devversion Mar 31, 2025
7187cee
build: update integration tests to use first-party packages
devversion Mar 31, 2025
7af1a4a
build: migrate all cross-package targets to use first-party links
devversion Mar 31, 2025
1d96060
build: update karma rules and interop to work with `rules_js`
devversion Mar 31, 2025
b7cae25
build: fix some remaining relative imports
devversion Apr 1, 2025
9ecf31c
build: workaround until `animations` package is released with fixed p…
devversion Apr 1, 2025
6f5289c
build: remove remaining jasmine_node_test and modernize webdriver test
devversion Apr 1, 2025
60634f6
build: fix integration tests never showing up as failing
devversion Apr 1, 2025
439be78
build: ensure TS respects `package.json` exports
devversion Apr 1, 2025
b474606
build: fix integration tests to work with real packages
devversion Apr 1, 2025
f5f0983
build: remove spec_bundle from `defaults.bzl`
devversion Apr 1, 2025
d9cf578
build: use `rules_esbuild` in universal testing
devversion Apr 1, 2025
f49cc3f
build: remove legacy linking code
devversion Apr 1, 2025
6d8ec4f
build: update angular shared dev-infra code to 37d8497 (#30778)
angular-robot Apr 2, 2025
ff5acbb
refactor: create individual BUILD files in core (#30787)
andrewseguin Apr 2, 2025
31344ef
build: remove leftover log (#30789)
crisbeto Apr 3, 2025
ea91960
build: update angular shared dev-infra code to 6127cf1 (#30792)
angular-robot Apr 3, 2025
ef1c734
build: update angular shared dev-infra code to b9bcdb3 (#30793)
angular-robot Apr 3, 2025
706612d
refactor: move tokens to their component directories (#30765)
andrewseguin Apr 4, 2025
25f8aff
build: cleanup more usages of `@npm//` repository
devversion Apr 3, 2025
947598c
Revert "build: migrate all cross-package targets to use first-party l…
devversion Apr 3, 2025
e4c9d96
build: clean-up to use fine-grained targets for faster rebuilds
devversion Apr 4, 2025
6f687dc
refactor: remove extraneous log (#30799)
andrewseguin Apr 4, 2025
99a9365
feat(material/core): handle prefers-reduced-motion automatically (#30…
crisbeto Apr 4, 2025
06377fe
build: update angular shared dev-infra code to 492cc1f (#30798)
angular-robot Apr 4, 2025
75a31c3
build: update angular shared dev-infra code to f172f3f (#30801)
angular-robot Apr 4, 2025
05f4503
fix(cdk-experimental/ui-patterns): add missing event handlers (#30786)
wagnermaciel Apr 4, 2025
e2b64d6
fix(material-angular-io): streamline directive and component metadata…
mistrykaran91 Apr 4, 2025
6d64113
fix(multiple): rename token prefixes to match components (#30802)
andrewseguin Apr 4, 2025
eee2e47
refactor(cdk-experimental/listbox): rename multiselectable to multi (…
wagnermaciel Apr 4, 2025
dbafdd0
build: update angular shared dev-infra code to e4bf37a (#30805)
angular-robot Apr 4, 2025
7536963
feat(cdk-experimental/listbox): readonly mode (#30803)
wagnermaciel Apr 4, 2025
3419e97
docs(material/chips): fix aria-label binding of chips-form-control-ex…
dominicbachmann Apr 5, 2025
334e60d
fix(multiple): rename hardcoded tokens that were renamed (#30807)
andrewseguin Apr 5, 2025
53d114c
docs(material/chips): fix aria label binding for reactive and templat…
mistrykaran91 Apr 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions goldens/material/chips/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export class MatChipGrid extends MatChipSet implements AfterContentInit, AfterVi
protected _allowFocusEscape(): void;
_blur(): void;
readonly change: EventEmitter<MatChipGridChange>;
_change(): void;
get chipBlurChanges(): Observable<MatChipEvent>;
protected _chipInput: MatChipTextControl;
// (undocumented)
Expand Down
72 changes: 72 additions & 0 deletions src/material/chips/chip-grid.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,44 @@ describe('MatChipGrid', () => {
}));
});

describe('chip with form control', () => {
let fixture: ComponentFixture<ChipsFormControlUpdate>;
let component: ChipsFormControlUpdate;
let nativeInput: HTMLInputElement;
let nativeButton: HTMLButtonElement;

beforeEach(() => {
fixture = createComponent(ChipsFormControlUpdate);
component = fixture.componentInstance;
nativeInput = fixture.nativeElement.querySelector('input');
nativeButton = fixture.nativeElement.querySelector('button[id="save"]');
});

it('should update the form control value when pressed enter', fakeAsync(() => {
nativeInput.value = 'hello';
nativeInput.focus();
fixture.detectChanges();

dispatchKeyboardEvent(document.activeElement!, 'keydown', ENTER);
fixture.detectChanges();
flush();

expect(component.keywordChipControl.value).not.toBeNull();
expect(component.keywordChipControl.value.length).toBe(1);
expect(nativeButton.disabled).toBeFalsy();

nativeInput.value = 'how are you ?';
nativeInput.focus();
fixture.detectChanges();

dispatchKeyboardEvent(document.activeElement!, 'keydown', ENTER);
fixture.detectChanges();
flush();

expect(component.keywordChipControl.value.length).toBe(2);
}));
});

function createComponent<T>(
component: Type<T>,
direction: Direction = 'ltr',
Expand Down Expand Up @@ -1218,3 +1256,37 @@ class ChipGridWithRemove {
this.chips.splice(event.chip.value, 1);
}
}

@Component({
template: `
<mat-form-field>
<mat-label>Keywords</mat-label>
<mat-chip-grid #chipGrid [formControl]="keywordChipControl">
@for (keyword of keywords; track keyword) {
<mat-chip-row>{{keyword}}</mat-chip-row>
}
</mat-chip-grid>
<input placeholder="New keyword..." [matChipInputFor]="chipGrid" (matChipInputTokenEnd)="add($event)">
</mat-form-field>
<button id="save" [disabled]="!keywordChipControl.valid">Save</button>
<button >Cancel</button>`,
standalone: false,
})
class ChipsFormControlUpdate {
keywords = new Array<string>();
keywordChipControl = new FormControl();

constructor() {
this.keywordChipControl.setValidators(Validators.required);
}

add(event: MatChipInputEvent): void {
const value = (event.value || '').trim();

if (value) {
this.keywords.push(value);
}

event.chipInput.clear();
}
}
8 changes: 8 additions & 0 deletions src/material/chips/chip-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,14 @@ export class MatChipGrid
}
}

/** When called, propagates the changes. */
_change() {
// Timeout is needed to wait for the focus() event trigger on chip input.
setTimeout(() => {
this._propagateChanges();
});
}

/**
* Removes the `tabindex` from the chip grid and resets it back afterwards, allowing the
* user to tab out of it. This prevents the grid from capturing focus and redirecting
Expand Down
3 changes: 2 additions & 1 deletion src/material/chips/chip-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ export class MatChipInput implements MatChipTextControl, OnChanges, OnDestroy {
value: this.inputElement.value,
chipInput: this,
});

this._chipGrid._change();
this._chipGrid.stateChanges.next();
event?.preventDefault();
}
}
Expand Down
Loading