diff --git a/package.json b/package.json index cbebfce391..b759435108 100644 --- a/package.json +++ b/package.json @@ -137,6 +137,7 @@ "vue": "^2.7.14", "vue2-daterange-picker": "^0.6.8", "weekstart": "^1.1.0", + "wicg-inert": "^3.1.2", "workbox-cacheable-response": "^6.5.4", "workbox-core": "^6.5.4", "workbox-expiration": "^6.5.4", diff --git a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts index 4292f5b151..3609dcad7c 100644 --- a/src/panels/lovelace/editor/card-editor/hui-card-picker.ts +++ b/src/panels/lovelace/editor/card-editor/hui-card-picker.ts @@ -14,9 +14,10 @@ import { classMap } from "lit/directives/class-map"; import { styleMap } from "lit/directives/style-map"; import { until } from "lit/directives/until"; import memoizeOne from "memoize-one"; +import "wicg-inert"; import { fireEvent } from "../../../../common/dom/fire_event"; -import "../../../../components/search-input"; import "../../../../components/ha-circular-progress"; +import "../../../../components/search-input"; import { isUnavailableState } from "../../../../data/entity"; import type { LovelaceCardConfig, @@ -114,12 +115,14 @@ export class HuiCardPicker extends LitElement { >
${this._filterCards(this._cards, this._filter).map( - (cardElement: CardElement) => cardElement.element + (cardElement: CardElement) => + html`
${cardElement.element}
` )}
+
+ `; } @@ -348,13 +351,19 @@ export class HuiCardPicker extends LitElement { grid-gap: 8px 8px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 20px; + list-style-type: none; + padding: 0; } .card { - height: 100%; - max-width: 500px; display: flex; flex-direction: column; + align-items: inherit; + justify-content: center; + padding: 0; + height: 100%; + width: 100%; + max-width: 500px; border-radius: var(--ha-card-border-radius, 12px); background: var(--primary-background-color, #fafafa); cursor: pointer; @@ -420,10 +429,6 @@ export class HuiCardPicker extends LitElement { .manual { max-width: none; - display: flex; - align-items: inherit; - justify-content: center; - padding: 0; } `, ]; diff --git a/yarn.lock b/yarn.lock index c3b869bfb9..5c926bfb75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9715,6 +9715,7 @@ fsevents@^1.2.7: webpack-manifest-plugin: ^5.0.0 webpackbar: ^5.0.2 weekstart: ^1.1.0 + wicg-inert: ^3.1.2 workbox-build: ^6.5.4 workbox-cacheable-response: ^6.5.4 workbox-core: ^6.5.4 @@ -16567,10 +16568,10 @@ typescript@^3.8.3: languageName: node linkType: hard -"wicg-inert@npm:^3.0.0": - version: 3.0.0 - resolution: "wicg-inert@npm:3.0.0" - checksum: 2f8fdc3140d8937fa01d89901b9a3bfb6d342a63bafb63d3e6ca2da59d4521803abca7d5890b56b20f1a16afe0584c775989f2034a83b1912716dfa8b3e7623e +"wicg-inert@npm:^3.0.0, wicg-inert@npm:^3.1.2": + version: 3.1.2 + resolution: "wicg-inert@npm:3.1.2" + checksum: 538c5cb7f240915a4c17741c644b135040764c6d8a05853099f2f342c95ce2645e6cf7c4f729775013dbc218e0da04b3f943875eba6ed4b38ff9dd431465d391 languageName: node linkType: hard