Skip to content

fix(InputDate/InputTime): emit focus and blur when focus enters or leaves the field - #6855

Open
61021 wants to merge 1 commit into
nuxt:v4from
61021:fix/input-date-time-focus-blur
Open

fix(InputDate/InputTime): emit focus and blur when focus enters or leaves the field#6855
61021 wants to merge 1 commit into
nuxt:v4from
61021:fix/input-date-time-focus-blur

Conversation

@61021

@61021 61021 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves #6854

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

@blur/@focus sat on the reka field root, which doesn't emit them, so they became native listeners on a div that never gets focused: the segments hold focus and blur doesn't bubble. They could never fire, and validate-on blur/focus was dead for both components.

Now focusin/focusout on the root, with a relatedTarget check so moving between segments doesn't emit.

Tests are red on v4. They nudge the specs' frozen clock first because Vue drops native events stamped at the exact listener-attach time.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

…aves the field

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@61021
61021 requested a review from benjamincanac as a code owner August 18, 2026 11:55
@github-actions github-actions Bot added the v4 #4488 label Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f49ff2e5-f252-42b2-8738-26bf37f3a261

📥 Commits

Reviewing files that changed from the base of the PR and between a630c94 and 0717858.

📒 Files selected for processing (4)
  • src/runtime/components/InputDate.vue
  • src/runtime/components/InputTime.vue
  • test/components/InputDate.spec.ts
  • test/components/InputTime.spec.ts

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

InputDate and InputTime now use focusin and focusout handlers. The handlers ignore focus changes between internal segments and preserve focus and blur emissions when focus enters or leaves the field. Tests cover these transitions for both components.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 07178

This localized fix updates focus and blur handling for InputDate and InputTime and adds coverage for the relevant event sequences; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main focus and blur behavior fix for both components.
Description check ✅ Passed The description directly explains the focus handling fix, related-target checks, affected validation behavior, and added tests.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Aug 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing 61021:fix/input-date-time-focus-blur (0717858) with v4 (a630c94)

Open in CodSpeed

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6855

commit: 0717858

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputDate/InputTime never emit focus and blur, so validate-on blur never runs in a Form

1 participant