Skip to content

fix(cacheView): replace datalist+input with select for enum cache entries#4973

Open
St0fF-NPL-ToM wants to merge 1 commit into
microsoft:mainfrom
St0fF-NPL-ToM:main
Open

fix(cacheView): replace datalist+input with select for enum cache entries#4973
St0fF-NPL-ToM wants to merge 1 commit into
microsoft:mainfrom
St0fF-NPL-ToM:main

Conversation

@St0fF-NPL-ToM

Copy link
Copy Markdown

Problem

Cache entries with a fixed set of choices (defined via CMake's STRINGS property) were rendered as <datalist> + <input type="text">. The browser automatically filters datalist suggestions based on the current input value — so opening the dropdown only shows options matching what is already typed. Without clearing the field first, it is impossible to see all available choices.

Fix

Replace <datalist> + <input type="text"> with a <select> element when choices are present:

  • All options are always visible when the dropdown opens (no filtering)
  • The current cache value is pre-selected via the selected attribute
  • A dedicated .cmake-input-select CSS class and oninput handler covers change events

When no choices are present, the <input type="text"> is used as before.

Test

  1. Open a configured CMake project with cache variables that have STRINGS choices (e.g. CMAKE_BUILD_TYPE with Debug;Release;RelWithDebInfo;MinSizeRel)
  2. Open the CMake Cache Editor (cmake.editCacheUI)
  3. Click the dropdown — all choices are visible immediately without clearing the field
  4. Select a value and save — CMake reconfigures with the new value

🤖 Generated with Claude Code

…ries

The previous implementation used <datalist> + <input type="text"> for
cache entries with a fixed set of choices (STRINGS property). The browser
filters datalist suggestions based on the current input value, making it
impossible to see all available options without first clearing the field.

Replace with a proper <select> element when choices are present:
- shows all options unfiltered when opened
- current value is pre-selected via the 'selected' attribute
- a separate .cmake-input-select class and oninput handler handles change events

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 this pull request may close these issues.

1 participant