Skip to content

[otp field] Fire onValueComplete for full paste#4690

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/otp-complete-paste
May 1, 2026
Merged

[otp field] Fire onValueComplete for full paste#4690
atomiks merged 2 commits into
mui:masterfrom
atomiks:codex/otp-complete-paste

Conversation

@atomiks
Copy link
Copy Markdown
Contributor

@atomiks atomiks commented Apr 27, 2026

Fixes #4679

Pasting a full OTP over an already complete value kept the field complete but skipped onValueComplete because completion was only queued when the previous value was incomplete. This keeps the existing transition behavior and adds a paste-specific path for complete-to-complete pastes, including when the pasted value matches the current value.

Changes

  • Fire onValueComplete for complete paste interactions while the field is already complete.
  • Add regression coverage for replacing a complete OTP and re-pasting the same complete value.
  • Update generated API docs for the callback semantics.

@atomiks atomiks added component: otp field type: bug It doesn't behave as expected. labels Apr 27, 2026 — with ChatGPT Codex Connector
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 27, 2026

commit: da6f41a

@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented Apr 27, 2026

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+176B(+0.04%) 🔺+54B(+0.04%)

Details of bundle changes

Performance

Total duration: 1,306.40 ms 🔺+74.42 ms(+6.0%) | Renders: 53 (+0) | Paint: 2,047.19 ms 🔺+128.21 ms(+6.7%)

Test Duration Renders
Checkbox mount (500 instances) 91.88 ms 🔺+24.45 ms(+36.3%) 1 (+0)
Popover mount (300 instances) 109.28 ms 🔺+19.27 ms(+21.4%) 2 (+0)
Slider mount (300 instances) 148.90 ms 🔺+16.71 ms(+12.6%) 3 (+0)
Tabs mount (200 instances) 228.09 ms 🔺+10.48 ms(+4.8%) 4 (+0)
Menu open (500 items) 73.45 ms 🔺+8.10 ms(+12.4%) 12 (+0)

…and 7 more — details


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

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 27, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit da6f41a
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69f3ea50d5fd440008f67175
😎 Deploy Preview https://deploy-preview-4690--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.

@atomiks atomiks marked this pull request as ready for review April 27, 2026 21:34
Copy link
Copy Markdown
Member

@mj12albert mj12albert left a comment

Choose a reason for hiding this comment

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

Looks good ~

@atomiks atomiks merged commit c274561 into mui:master May 1, 2026
22 of 23 checks passed
@atomiks atomiks deleted the codex/otp-complete-paste branch May 1, 2026 00:24
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.

[otp field] onValueComplete is not triggered when a pasted number fully replaces the previous one

2 participants