Skip to content

Commit

Permalink
[Input] Fix autofill detection
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 21, 2024
1 parent 5b9a362 commit 9257196
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions docs/pages/experiments/base/autofill.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import * as React from 'react';
import Button from '@mui/material/Button';
import TextField from '@mui/material/TextField';
import Box from '@mui/material/Box';

export default function Autofill() {
return (
<Box component="form" sx={{ maxWidth: 400, m: 2 }}>
<TextField
id="email"
type="email"
name="email"
label="Email"
placeholder="[email protected]"
autoComplete="email"
autoFocus
required
fullWidth
variant="outlined"
/>
<TextField
name="password"
label="Password"
placeholder="••••••"
type="password"
id="password"
autoComplete="current-password"
autoFocus
required
fullWidth
variant="outlined"
/>
<Button type="submit" fullWidth variant="contained">
Sign in
</Button>
</Box>
);
}
4 changes: 2 additions & 2 deletions packages/mui-material/src/InputBase/InputBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ export const InputBaseInput = styled('input', {
);

const InputGlobalStyles = globalCss({
'@keyframes mui-auto-fill': { from: { display: 'block' } },
'@keyframes mui-auto-fill-cancel': { from: { display: 'block' } },
'@keyframes mui-auto-fill': {},
'@keyframes mui-auto-fill-cancel': {},
});

/**
Expand Down

0 comments on commit 9257196

Please sign in to comment.