Skip to content

[TextField] Safari scrolls to top on password field focus with "filled" and "standard" variants #44396

Open
@Austin1serb

Description

@Austin1serb

Steps to reproduce

Link to live example: (required)

Screen.Recording.2024-11-12.at.12.14.52.PM.mov

Steps to Reproduce:
1. Go to the TextField demo page on MUI’s website.
2. Scroll to any TextField with type="password" and set to the “filled” or “standard” variant.
3. Click on the password field in Safari (on iOS 17 or macOS).
4. Observe that the page briefly scrolls to the top of the viewport as Safari displays the password suggestion prompt.

Current behavior

In Safari, when focusing on a TextField with type="password" in either the “filled” or “standard” variant, the page flashes to the top as Safari’s password suggestion prompt appears. This behavior does not occur with the “outlined” variant.

Expected behavior

The page should remain stable and not scroll when the password field is focused, regardless of the variant in use.

Context

This issue affects the usability of forms with password fields in Safari by causing unexpected scrolling behavior. The issue appears to be related to Safari’s password suggestion feature, affecting both mobile and desktop Safari users.

Your environment

npx @mui/envinfo
 System:
    OS: macOS 14.6.1 / iOS 17
  Binaries:
    Node: 20.16.0
    npm: 10.8.1
  Browsers:
    Safari: 17.6 (macOS), iOS Safari (iOS 17)
  npmPackages:
    @mui/material: ^6.1.6
    react: ^18.2.0

Search keywords: TextField password scroll Safari, TextField password field Safari bug, Safari scroll to top password field, MUI TextField password variant issue

Metadata

Metadata

Assignees

Labels

browser: Safaribug 🐛Something doesn't workcomponent: text fieldThis is the name of the generic UI component, not the React module!

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions