Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/cdk/listbox/listbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ describe('CdkOption and CdkListbox', () => {
expect(() => {
testComponent.formControl.setValue(['orange', 'banana']);
fixture.detectChanges();
}).toThrowError('Listbox cannot have more than one selected value in multi-selection mode.');
}).toThrowError('Listbox cannot have more than one selected value in single selection mode.');
});

it('should throw when an invalid value is selected', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ export class CdkListbox<T = unknown> implements AfterContentInit, OnDestroy, Con
const invalidValues = this._getInvalidOptionValues(selected);

if (!this.multiple && selected.length > 1) {
throw Error('Listbox cannot have more than one selected value in multi-selection mode.');
throw Error('Listbox cannot have more than one selected value in single selection mode.');
}

if (invalidValues.length) {
Expand Down
Loading