Skip to content

Incorrect IntelliSense: <button type=""> suggests obsolete menu value (HTML spec allows only submit/reset/button) #249820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CrexCrexBy opened this issue May 26, 2025 · 0 comments · Fixed by microsoft/vscode-custom-data#116
Assignees

Comments

@CrexCrexBy
Copy link

CrexCrexBy commented May 26, 2025

Image

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.100.2 (also occurs in online version)
  • OS Version: Windows_NT x64 10.0.22621 (reproducible across platforms)

Core Issue:

VS Code incorrectly includes type="menu" as a suggested value for <button> elements in IntelliSense, despite this:

  • Not being a valid button type in any modern HTML specification
  • Having been removed from standards 20+ years ago
  • Never being properly implemented in browsers

Steps to Reproduce:

  1. Create a new HTML file
  2. Type <button type="
  3. Open IntelliSense (Ctrl+Space)
  4. Observe menu appearing in the suggestions list

Expected Behavior:

IntelliSense should only suggest the three valid HTML button types:

  • submit
  • reset
  • button

Actual Behavior:

IntelliSense incorrectly includes:

  • menu (obsolete and invalid)

Technical Documentation:

  1. HTML Living Standard (WHATWG) explicitly lists only three valid types:
    https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-type
  2. MDN documentation confirms only three valid types:
    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type
  3. Historical context: menu was removed in HTML 4.0 (1997)

Impact:

  • Misleads developers into using invalid HTML
  • Pollutes codebases with non-standard attributes
  • Contradicts VS Code's goal of standards-compliant tooling

Requested Fix:

Completely remove menu from:

  1. IntelliSense suggestions for button types
  2. Any internal validation whitelists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants