mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 01:36:49 +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;
|
||||
if (!oldHass || oldHass.panelUrl !== this.hass.panelUrl) {
|
||||
this.shadowRoot!.querySelector(
|
||||
".iron-selected"
|
||||
const selectedEl = this.shadowRoot!.querySelector(".iron-selected");
|
||||
if (selectedEl) {
|
||||
// @ts-ignore
|
||||
)!.scrollIntoViewIfNeeded();
|
||||
selectedEl.scrollIntoViewIfNeeded();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ export class HuiNotificationDrawer extends EventsMixin(
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<app-drawer id='drawer' opened="{{open}}">
|
||||
<app-drawer id='drawer' opened="{{open}}" disable-swipe>
|
||||
<app-toolbar>
|
||||
<div main-title>[[localize('ui.notification_drawer.title')]]</div>
|
||||
<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 format_date_time from "../../../common/datetime/format_date_time";
|
||||
import { fireEvent } from "../../../common/dom/fire_event";
|
||||
import { repeat } from "lit-html/directives/repeat";
|
||||
|
||||
@customElement("ha-automation-picker")
|
||||
class HaAutomationPicker extends LitElement {
|
||||
@ -74,9 +73,7 @@ class HaAutomationPicker extends LitElement {
|
||||
</p>
|
||||
</div>
|
||||
`
|
||||
: repeat(
|
||||
this.automations,
|
||||
(automation) => automation.entity_id,
|
||||
: this.automations.map(
|
||||
(automation) => html`
|
||||
|
||||
<div class='automation'>
|
||||
|
@ -25,7 +25,6 @@ import { haStyle } from "../../../resources/styles";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
import { triggerScript } from "../../../data/script";
|
||||
import { showToast } from "../../../util/toast";
|
||||
import { repeat } from "lit-html/directives/repeat";
|
||||
|
||||
@customElement("ha-script-picker")
|
||||
class HaScriptPicker extends LitElement {
|
||||
@ -57,9 +56,7 @@ class HaScriptPicker extends LitElement {
|
||||
<p>We couldn't find any scripts.</p>
|
||||
</div>
|
||||
`
|
||||
: repeat(
|
||||
this.scripts,
|
||||
(script) => script.entity_id,
|
||||
: this.scripts.map(
|
||||
(script) => html`
|
||||
<div class="script">
|
||||
<paper-icon-button
|
||||
|
Loading…
x
Reference in New Issue
Block a user