mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 10:16:46 +00:00
Random fixes (#3328)
* Fix scroll into view on first load * Do not crash when deleting script/automation * Disable swipe on notification drawer
This commit is contained in:
parent
deaccd6cd4
commit
6f77992387
@ -306,10 +306,11 @@ class HaSidebar extends LitElement {
|
|||||||
}
|
}
|
||||||
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
const oldHass = changedProps.get("hass") as HomeAssistant | undefined;
|
||||||
if (!oldHass || oldHass.panelUrl !== this.hass.panelUrl) {
|
if (!oldHass || oldHass.panelUrl !== this.hass.panelUrl) {
|
||||||
this.shadowRoot!.querySelector(
|
const selectedEl = this.shadowRoot!.querySelector(".iron-selected");
|
||||||
".iron-selected"
|
if (selectedEl) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
)!.scrollIntoViewIfNeeded();
|
selectedEl.scrollIntoViewIfNeeded();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ export class HuiNotificationDrawer extends EventsMixin(
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<app-drawer id='drawer' opened="{{open}}">
|
<app-drawer id='drawer' opened="{{open}}" disable-swipe>
|
||||||
<app-toolbar>
|
<app-toolbar>
|
||||||
<div main-title>[[localize('ui.notification_drawer.title')]]</div>
|
<div main-title>[[localize('ui.notification_drawer.title')]]</div>
|
||||||
<ha-paper-icon-button-prev on-click="_closeDrawer"></paper-icon-button>
|
<ha-paper-icon-button-prev on-click="_closeDrawer"></paper-icon-button>
|
||||||
|
@ -26,7 +26,6 @@ import { HomeAssistant } from "../../../types";
|
|||||||
import { AutomationEntity } from "../../../data/automation";
|
import { AutomationEntity } from "../../../data/automation";
|
||||||
import format_date_time from "../../../common/datetime/format_date_time";
|
import format_date_time from "../../../common/datetime/format_date_time";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { repeat } from "lit-html/directives/repeat";
|
|
||||||
|
|
||||||
@customElement("ha-automation-picker")
|
@customElement("ha-automation-picker")
|
||||||
class HaAutomationPicker extends LitElement {
|
class HaAutomationPicker extends LitElement {
|
||||||
@ -74,9 +73,7 @@ class HaAutomationPicker extends LitElement {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: repeat(
|
: this.automations.map(
|
||||||
this.automations,
|
|
||||||
(automation) => automation.entity_id,
|
|
||||||
(automation) => html`
|
(automation) => html`
|
||||||
|
|
||||||
<div class='automation'>
|
<div class='automation'>
|
||||||
|
@ -25,7 +25,6 @@ import { haStyle } from "../../../resources/styles";
|
|||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { triggerScript } from "../../../data/script";
|
import { triggerScript } from "../../../data/script";
|
||||||
import { showToast } from "../../../util/toast";
|
import { showToast } from "../../../util/toast";
|
||||||
import { repeat } from "lit-html/directives/repeat";
|
|
||||||
|
|
||||||
@customElement("ha-script-picker")
|
@customElement("ha-script-picker")
|
||||||
class HaScriptPicker extends LitElement {
|
class HaScriptPicker extends LitElement {
|
||||||
@ -57,9 +56,7 @@ class HaScriptPicker extends LitElement {
|
|||||||
<p>We couldn't find any scripts.</p>
|
<p>We couldn't find any scripts.</p>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: repeat(
|
: this.scripts.map(
|
||||||
this.scripts,
|
|
||||||
(script) => script.entity_id,
|
|
||||||
(script) => html`
|
(script) => html`
|
||||||
<div class="script">
|
<div class="script">
|
||||||
<paper-icon-button
|
<paper-icon-button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user