From 64a687676ab2127b415d33c1dc72d45a98dcd437 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Sat, 24 Jan 2026 09:01:29 +0100 Subject: [PATCH] fix(cdk/listbox): incorrect wording in error message Fixes some incorrect wording in an error thrown by the CDK listbox. Fixes #32643. --- src/cdk/listbox/listbox.spec.ts | 2 +- src/cdk/listbox/listbox.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cdk/listbox/listbox.spec.ts b/src/cdk/listbox/listbox.spec.ts index d588431d4b5b..393f9c3123d3 100644 --- a/src/cdk/listbox/listbox.spec.ts +++ b/src/cdk/listbox/listbox.spec.ts @@ -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', () => { diff --git a/src/cdk/listbox/listbox.ts b/src/cdk/listbox/listbox.ts index 106cad5cde25..f721f8b3ab04 100644 --- a/src/cdk/listbox/listbox.ts +++ b/src/cdk/listbox/listbox.ts @@ -1018,7 +1018,7 @@ export class CdkListbox 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) {