Skip to content

Conversation

@eamd-wq
Copy link
Contributor

@eamd-wq eamd-wq commented Nov 13, 2025

Close #14088

Correct the naming of the enterKeyHint property in InputHTMLAttributes

Change the enterKeyHint property to the lowercase form enterkeyhint to comply with HTML standard specifications, and add a deprecation flag to prompt for migration.

Summary by CodeRabbit

  • Refactor
    • Updated HTML input enter key hint attribute naming and expanded supported values to include 'next' and 'previous'. Previous property name remains available as a deprecated alias.

…InputHTMLAttributes

Change the enterKeyHint property to the lowercase form enterkeyhint to comply with HTML standard specifications, and add a deprecation flag to prompt for migration.
@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Walkthrough

The change renames the HTML input attribute enterKeyHint to enterkeyhint and expands its allowed values from an unspecified type to an explicit union including 'enter', 'done', 'go', 'next', 'previous', 'search', and 'send'. A deprecated alias maintains backward compatibility.

Changes

Cohort / File(s) Summary
Input attribute refactor
packages/runtime-dom/src/jsx.ts
Renamed enterKeyHint to enterkeyhint with explicit union type definition. Added 'next' and 'previous' to allowed values. Introduced deprecated enterKeyHint alias for backward compatibility.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Single file with straightforward type definition change
  • Deprecated alias properly preserves backward compatibility
  • No logic changes or control flow modifications

Poem

🐰 The keys now speak in lowercase grace,
With hints expanded—next, previous space!
Old names aliased, deprecated but kind,
New values await in the union we find.
Enter your journey, search or send with cheer—
Better HTML attributes, crystal clear! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: correcting the enterKeyHint property naming in InputHTMLAttributes from camelCase to lowercase form to match HTML standards.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/runtime-dom/src/jsx.ts (1)

550-558: Add enterkeyhint property to TextareaHTMLAttributes interface for complete HTML spec compliance.

The PR correctly updates InputHTMLAttributes with the enterkeyhint property, but the HTML attribute enterkeyhint is valid on textarea elements as well. The TextareaHTMLAttributes interface (line 760) is missing this property, creating an inconsistency since it's already listed in packages/shared/src/domAttrConfig.ts (line 69) as a recognized global attribute.

Required update: Add the same enterkeyhint property definition to TextareaHTMLAttributes to ensure complete HTML spec coverage and consistency across all applicable input-capable elements.

🧹 Nitpick comments (1)
packages/runtime-dom/src/jsx.ts (1)

559-562: Consider enhancing the deprecation notice with a timeline.

The deprecation strategy is sound, maintaining backward compatibility while guiding users to the new property. However, the deprecation comment could be more informative by including when the property will be removed.

Consider updating the deprecation comment to include version information:

  /**
-  * @deprecated Use `enterkeyhint` instead.
+  * @deprecated Use `enterkeyhint` instead. This alias will be removed in Vue 4.0.
   */
  enterKeyHint?: InputHTMLAttributes['enterkeyhint']

This helps users plan their migration timeline accordingly.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e9c676f and 0763367.

📒 Files selected for processing (1)
  • packages/runtime-dom/src/jsx.ts (2 hunks)

@edison1105 edison1105 changed the title fix(runtime-dom): Correct the naming of the enterKeyHint property in InputHTMLAttributes types(jsx): correct the naming of the enterKeyHint property in InputHTMLAttributes Nov 13, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 13, 2025

Open in StackBlitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@14090

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@14090

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@14090

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@14090

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@14090

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@14090

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@14090

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@14090

@vue/shared

npm i https://pkg.pr.new/@vue/shared@14090

vue

npm i https://pkg.pr.new/vue@14090

@vue/compat

npm i https://pkg.pr.new/@vue/compat@14090

commit: 0763367

@github-actions
Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 103 kB 38.9 kB 35.1 kB
vue.global.prod.js 161 kB 58.8 kB 52.4 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.9 kB 18.3 kB 16.8 kB
createApp 55 kB 21.4 kB 19.6 kB
createSSRApp 59.3 kB 23.1 kB 21.1 kB
defineCustomElement 60.6 kB 23.1 kB 21.1 kB
overall 69.3 kB 26.6 kB 24.3 kB

@edison1105 edison1105 merged commit f40baa2 into vuejs:main Nov 18, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputHTMLAttributes 的 enterKeyHint属性大小写问题

2 participants