Editor text fields: use native input instead of ha-textfield — v0.16.4#31
Merged
Merged
Conversation
The shared _tf() editor helper built text/number fields with `ha-textfield`. That Home Assistant element isn't guaranteed to be registered in every frontend build; when it's missing it renders as an empty invisible custom element, so every text field silently vanished from the visual editors — Title, Name, Icon, Unit, Decimals, Bar max, Energy label, History window. The controls that still showed use ha-entity-picker, native <select>, and ha-switch, which were loaded. Rewrite _tf() to render a native <input class="tf"> inside a labelled .field wrapper, matching the native <select class="sel"> already used for dropdowns. Same API (type, suffix); add .tf/.tf-row/.tf-suffix styles; drop the obsolete ha-textfield style rule. Fixes invisible text fields across every Prism card editor, not just the power card. Verified in Chromium with ha-textfield deliberately undefined: all fields now render and editing the title fires config-changed. VERSION 0.16.3 -> 0.16.4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014cpNPVU8j1iiU9CnXgr5JY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
In the power card's visual editor, every text field was missing — Title, Name, Icon, Unit, Decimals, Bar max, Energy label, History window. Only the entity pickers, the accent/mode dropdowns, and the switches showed. So there was no way to set a title (or any other text option) from the UI.
Cause
The shared
_tf()editor helper built its fields withha-textfield. That Home Assistant element isn't guaranteed to be registered in every frontend build — and in the affected instance it was undefined, so each field rendered as an empty, invisible custom element and silently disappeared. The controls that survived useha-entity-picker, native<select>, andha-switch, which were loaded.Fix
Rewrote
_tf()to render a native<input class="tf">inside a labelled.fieldwrapper — the same native-element approach already used for the dropdowns (<select class="sel">). Same API (type,suffix); added.tf/.tf-row/.tf-suffixstyles; removed the now-unusedha-textfieldstyle rule.This fixes the invisible text fields across all 22 card editors, not just the power card.
Testing
ha-textfielddeliberately left undefined (reproducing the user's environment): all 8 text fields now render (visible, ~41px), and typing into Title firesconfig-changedwith the new title.bash build.sh+node test/smoke.jsgreen.VERSION 0.16.3 → 0.16.4.
🤖 Generated with Claude Code
Generated by Claude Code