Skip to content

Commit 9b54cb2

Browse files
committed
fix(cdk/listbox): incorrect wording in error message (#32697)
Fixes some incorrect wording in an error thrown by the CDK listbox. Fixes #32643. (cherry picked from commit c71256d)
1 parent 4b8fc71 commit 9b54cb2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cdk/listbox/listbox.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ describe('CdkOption and CdkListbox', () => {
926926
expect(() => {
927927
testComponent.formControl.setValue(['orange', 'banana']);
928928
fixture.detectChanges();
929-
}).toThrowError('Listbox cannot have more than one selected value in multi-selection mode.');
929+
}).toThrowError('Listbox cannot have more than one selected value in single selection mode.');
930930
});
931931

932932
it('should throw when an invalid value is selected', () => {

src/cdk/listbox/listbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ export class CdkListbox<T = unknown> implements AfterContentInit, OnDestroy, Con
10181018
const invalidValues = this._getInvalidOptionValues(selected);
10191019

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

10241024
if (invalidValues.length) {

0 commit comments

Comments
 (0)