Skip to content

[Autocomplete] ability to change the root element #47755

@GerardasB

Description

@GerardasB

Summary

Autocomplete component should support changing of the root element by exposing the component prop or by exposing the root property in the slotProps prop, similarly to chip

Examples

https://stackblitz.com/edit/vitejs-vite-nwrkid3s?file=src%2FApp.tsx%3AL14

Motivation

This is useful when customizing the semantics of Autocomplete from within a theme (without having to deliver wrapper components). I.e. having a context that wraps the input is useful when adding group semantics with associated label (context can be used to determine if the TextField is rendered within Autocomplete w/o needing to lookup DOM structure/class names).

Search keywords: autocomplete, root element, component prop

Metadata

Metadata

Assignees

Labels

scope: autocompleteChanges related to the autocomplete. This includes ComboBox.status: waiting for maintainerThese issues haven't been looked at yet by a maintainer.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions