thomasloven / lovelace-layout-card

🔹 Get more control over the placement of lovelace cards.
MIT License
1.05k stars 125 forks source link

`mwc-tab-bar` Does Not Render/Is Not Present in Sections View #296

Closed Nerwyn closed 1 month ago

Nerwyn commented 2 months ago

My Home Assistant version: 2024.7.0

Layout-card version (FROM BROWSER CONSOLE):

What I am doing: Using the layout-card editor in an experimental sections view, without previously navigating to a non-sections view (to prevent mwc-tab-bar from being loaded and available for custom cards to use) or refreshing the page after using the add card dialog.

What I expected to happen: mwc-tab-bar to render like it does on traditional views.

What happened instead: mwc-tab-bar doesn't seem to load in the new sections view. Custom cards that reference it end up not loading anything.

Minimal steps to reproduce:

  1. Create a new view of type Sections (experimental).
  2. Click the add card button in a section.
  3. Note the mwc-tab-bar element in use at the top of the add card dialog.
  4. Add a Custom: Layout Card. Note how the layout/cards tab bar is visible.
  5. Save the layout card and then refresh the page.
  6. Edit the previously created layout card. Note how that since no Home Assistant elements loaded mwc-tab-bar, it does not render in the layout card editor. image
type: custom:layout-card
layout_type: masonry
layout: {}
cards: []

Error messages from the browser console:

NA

Other notes:

I ran into this issue with the config UI of one of my custom cards as well. I ended up switching to paper-tabs as those should always be present in Home Assistant views due to their use as the view buttons and the config/visibility/layout selector.


By putting an X in the boxes ([X]) below, I indicate that I:

Nerwyn commented 1 month ago

As of 2024.8 Home Assistant has switched the edit card paper-tabs bar to a mwc-tab-bar, fixing this issue.

image