mui / mui/material-ui

[InputAdornment] Textfield autofill background color isn't applied to InputAdornment

Open
#33,519 7 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

scope: text field type: new feature
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Current behavior 😯

An autofilled textfield's InputAdornment doesn't get the same background color as the TextField.
image

Expected behavior 🤔

I expected the InputAdornment to have the same background color as the TextField.

Steps to reproduce 🕹
<TextField
  id="password"
  type={showPassword ? 'text' : 'password'}
  label="Password"
  placeholder="Password"
  autoComplete="current-password"
  InputProps={{
    endAdornment: (
      <InputAdornment position="end">
        <IconButton aria-label="toggle password visibility" onClick={togglePassword} edge="end">
          {showPassword ? <VisibilityOff /> : <Visibility />}
        </IconButton>
      </InputAdornment>
    )
  }}
/> 

Steps:

  1. Have saved credentials
  2. Refresh your page to trigger autofill
Context 🔦

Could just be me but with the missing background color the field looks bugged.

Your environment 🌎
npx @mui/envinfo
  System:
    OS: Windows 10 10.0.19042
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 8.12.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 103.0.5060.114
    Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.49)
  npmPackages:
    @emotion/react: ^11.8.2 => 11.9.3
    @emotion/styled: ^11.8.1 => 11.9.3
    @mui/base:  5.0.0-alpha.85
    @mui/icons-material: ^5.5.1 => 5.8.4
    @mui/material: ^5.7.0 => 5.8.4
    @mui/private-theming:  5.8.4
    @mui/styled-engine:  5.8.0
    @mui/system:  5.8.4
    @mui/types:  7.1.4
    @mui/utils:  5.8.4
    @mui/x-data-grid: ^5.10.0 => 5.12.1
    @mui/x-date-pickers: ^5.0.0-alpha.2 => 5.0.0-alpha.6
    @types/react: ^18.0.12 => 18.0.12
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: ^4.7.3 => 4.7.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided TextField and InputAdornment example with saved credentials and autofill in Chrome or Edge. Inspect the TextField and InputAdornment autofill styling, then verify that the adornment receives the same background color as the autofilled field.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.