Skip to content

[otp field] Avoid password manager bubbles after first input - #4868

Merged
atomiks merged 1 commit into
mui:masterfrom
atomiks:codex/otp-field-password-manager-maxlength
May 20, 2026
Merged

atomiks merged 1 commit into
mui:masterfrom
atomiks:codex/otp-field-password-manager-maxlength

Conversation

@atomiks

@atomiks atomiks commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Only the first OTP field input needs the full-code max length. Later visible inputs now omit maxlength, so password managers do not treat every slot as a separate one-character target while typing still handles multi-character
changes.

This notably affected iCloud password manager

Root cause

Each visible slot had a maxlength, which could cause password manager UI to appear after later inputs.

Changes

  • Keep the full-code maxlength only on the first visible OTP input.
  • Assert later visible inputs omit maxlength and cover multi-character replacement from a later slot.

@atomiks atomiks added type: bug It doesn't behave as expected. component: otp field labels May 20, 2026 — with ChatGPT Codex Connector
@atomiks
atomiks requested a review from aarongarciah May 20, 2026 10:18
@pkg-pr-new

pkg-pr-new Bot commented May 20, 2026

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@4868
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@4868
    

commit: 020f3ae

@code-infra-dashboard

code-infra-dashboard Bot commented May 20, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+5B(0.00%) ▼-2B(0.00%)

Details of bundle changes

Performance

Total duration: 1,398.88 ms +230.70 ms(+19.7%) | Renders: 50 (+0) | Paint: 2,116.74 ms +331.55 ms(+18.6%)

Test Duration Renders
Select mount (200 instances) 188.61 ms 🔺+48.32 ms(+34.4%) 3 (+0)
Menu mount (300 instances) 183.45 ms 🔺+45.25 ms(+32.7%) 2 (+0)
Slider mount (300 instances) 198.70 ms 🔺+41.45 ms(+26.4%) 3 (+0)
Mixed surface mount (app-like density) 92.22 ms 🔺+24.12 ms(+35.4%) 5 (+0)
Select open (500 options) 64.16 ms 🔺+21.81 ms(+51.5%) 14 (+0)

7 tests within noise — details


Check out the code infra dashboard for more information about this PR.

@atomiks
atomiks marked this pull request as ready for review May 20, 2026 10:20
@netlify

netlify Bot commented May 20, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 020f3ae
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a0d8a2c5672a70008623692
😎 Deploy Preview https://deploy-preview-4868--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@aarongarciah aarongarciah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. The iCloud Password extension popup doesn't appear anymore after the first input. In terms of assistive tech, it looks like we don't lose anything by removing maxlength="1"?

before

otp-icloud-passwords.mp4

after

Kapture.2026-05-20.at.12.26.38.mp4

@atomiks

atomiks commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

In terms of assistive tech, it looks like we don't lose anything by removing maxlength="1"?

When I was testing VoiceOver, NVDA, Narrator, etc., they didn't announce anything relating to the length of the input, it's the aria-label (and group labeling/<input> tag) that are announced. So yeah that concept appears hidden to them currently

@atomiks
atomiks merged commit be57166 into mui:master May 20, 2026
6 of 7 checks passed
@atomiks
atomiks deleted the codex/otp-field-password-manager-maxlength branch May 20, 2026 12:44
mbrookes pushed a commit to mbrookes/base-ui that referenced this pull request May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: otp field type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants