From c617cd7c815cfcebebc608aa4e1c75ea8e6b0629 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 21 Feb 2024 10:53:20 +0100 Subject: [PATCH] fix(cdk/listbox): make typeahead label nullable (#28602) Allows the `cdkOptionTypeaheadLabel` to be set to a nullable value. Fixes #28464. (cherry picked from commit d1d1d02f914b40363009734c10cf8a797d62a27b) --- src/cdk/listbox/listbox.ts | 2 +- tools/public_api_guard/cdk/listbox.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cdk/listbox/listbox.ts b/src/cdk/listbox/listbox.ts index fa6782e10b52..f81e19e334a4 100644 --- a/src/cdk/listbox/listbox.ts +++ b/src/cdk/listbox/listbox.ts @@ -113,7 +113,7 @@ export class CdkOption implements ListKeyManagerOption, Highlightab * The text used to locate this item during listbox typeahead. If not specified, * the `textContent` of the item will be used. */ - @Input('cdkOptionTypeaheadLabel') typeaheadLabel: string; + @Input('cdkOptionTypeaheadLabel') typeaheadLabel: string | null; /** Whether this option is disabled. */ @Input({alias: 'cdkOptionDisabled', transform: booleanAttribute}) diff --git a/tools/public_api_guard/cdk/listbox.md b/tools/public_api_guard/cdk/listbox.md index f4db92475bec..8855be392fb9 100644 --- a/tools/public_api_guard/cdk/listbox.md +++ b/tools/public_api_guard/cdk/listbox.md @@ -127,7 +127,7 @@ export class CdkOption implements ListKeyManagerOption, Highlightab setActiveStyles(): void; setInactiveStyles(): void; toggle(): void; - typeaheadLabel: string; + typeaheadLabel: string | null; value: T; // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration, "[cdkOption]", ["cdkOption"], { "id": { "alias": "id"; "required": false; }; "value": { "alias": "cdkOption"; "required": false; }; "typeaheadLabel": { "alias": "cdkOptionTypeaheadLabel"; "required": false; }; "disabled": { "alias": "cdkOptionDisabled"; "required": false; }; "enabledTabIndex": { "alias": "tabindex"; "required": false; }; }, {}, never, never, true, never>;