Skip to content

[Autocomplete][material-ui] fullwidth=true always passed to inner component #36841

@guoyunhe

Description

@guoyunhe

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://stackblitz.com/edit/react-zc5u5j?file=demo.js

Steps:

  1. create <Autocomplete/> with a <TextField/> as inner input.
  2. see the render result.
  3. inspect React props with React Dev Tools.

Current behavior 😯

The <Autocomplete/> is full width, even if I didn't specify fullwidth prop.

After inspecting the props of <TextField/>, I found that <Autocomplete/> always pass fullwidth={true} to inner input component, which is unexpected.

image

Expected behavior 🤔

It should not be fullwidth if I din't tell it to be. This makes the component more predictable.

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: autocompleteChanges related to the autocomplete. This includes ComboBox.type: bugIt doesn't behave as expected.

    Projects

    Status

    To process

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions