feat(CdkMenu): Option to disable typeahead in CdkMenu #30384
Labels
area: cdk/menu
feature
This issue represents a new feature or feature request rather than a bug or bug fix
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Feature Description
We would like to add an option in the
CdkMenu
to disable the integrated TypeAhead feature.Currently, the menu activates the TypeAhead for its
FocusKeyManager
automatically:components/src/cdk/menu/menu-base.ts
Line 175 in e91d509
The proposal would be to add an input like
cdkMenuTypeAhead: boolean
which defaults to true but can be used to skip the TypeAhead activation:Alternative
An alternative approach might be a combination of the following features, so the described use case can be accomplished by the
CdkMenu
itself._pressedLetters
) publicly available, so it can be displayed.2.a Add a secondary
includes
search to the currentstartsWith
.2.b Make the search logic customizable with configurable predicate function.
Use Case
The use case is a custom search feature for our menus, which conflicts with the integrated TypeAhead.
We want to display the current search term and search by
startsWith
&includes
.🗨 I would appreciate some feedback, if this feature has a chance of being accepted. Then I can prepare a PR for this.
The text was updated successfully, but these errors were encountered: