Skip to content

The 'select' selector does not display its name at the correct size when its values are numbers rather than strings #28784

@alex-taylor

Description

@alex-taylor

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

The 'select' selector displays its name at a large font-size when no item has been selected. Once something is selected, the name is reduced in size so that it displays above the item:

Image

If the values for the selector are numbers, however, once the selector loses focus the name is not reduced and overlaps the item:

Image

This appears to be because the CSS class "mdc-floating-label--float-above" is removed from the "label" span element when the selector loses focus. It is present for selectors with string items:

Image

But not for selectors with number items:

Image

Describe the behavior you expected

The name should be displayed at the reduced size when an item is selected, regardless of whether the selector has focus.

Steps to reproduce the issue

Create a 'select' selector in your card's UI editor:

    {
      name: EnergyUnitsOptions.Prefix_Threshold,
      selector: {
        select: {
          mode: 'dropdown',
          options: [ 1, 2, 3 ]
        }
      }
    }

Open the UI editor in HASS, and play around. You should observe that when the selector does not have the input focus, its name overlaps the selected value

What version of Home Assistant Core has the issue?

2025.12.5

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue?

Vivaldi 7.7.3851.66

Which operating system are you using to run this browser?

Windows 10 Pro 22H2 19045.6466

State of relevant entities

Problem-relevant frontend configuration

JavaScript errors shown in your browser console/inspector

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions