From 51b79b33fb3ca531e77e51f75cb3b34fa3ddb418 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Fri, 18 Jul 2025 15:04:22 +0300 Subject: [PATCH] Disable network graph emphasis on mobile (#26106) --- src/components/chart/ha-network-graph.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/chart/ha-network-graph.ts b/src/components/chart/ha-network-graph.ts index 9edd2eccaa..2293b9fc02 100644 --- a/src/components/chart/ha-network-graph.ts +++ b/src/components/chart/ha-network-graph.ts @@ -106,14 +106,18 @@ export class HaNetworkGraph extends SubscribeMixin(LitElement) { if (!GraphChart) { return nothing; } + const isMobile = window.matchMedia( + "all and (max-width: 450px), all and (max-height: 500px)" + ).matches; return html` { const containerWidth = this.clientWidth; const containerHeight = this.clientHeight; @@ -184,7 +189,7 @@ export class HaNetworkGraph extends SubscribeMixin(LitElement) { position: "right", }, emphasis: { - focus: "adjacency", + focus: isMobile ? "none" : "adjacency", }, force: { repulsion: [400, 600],