From 77711ea71128ded03b83014c052ed9d2f1465cb8 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Tue, 4 Dec 2018 05:57:43 -0600 Subject: [PATCH] Stop MouseEvent from reach parent element (#2174) --- .../lovelace/entity-rows/hui-media-player-entity-row.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts index 7707991a96..0181c068ae 100644 --- a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts @@ -145,13 +145,15 @@ class HuiMediaPlayerEntityRow extends hassLocalizeLitMixin(LitElement) return prefix && suffix ? `${prefix}: ${suffix}` : prefix || suffix || ""; } - private _playPause(): void { + private _playPause(ev: MouseEvent): void { + ev.stopPropagation(); this.hass!.callService("media_player", "media_play_pause", { entity_id: this._config!.entity, }); } - private _nextTrack(): void { + private _nextTrack(ev: MouseEvent): void { + ev.stopPropagation(); this.hass!.callService("media_player", "media_next_track", { entity_id: this._config!.entity, });