From 23200c131629574086054228588962b304cdd2ca Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Tue, 3 Sep 2019 20:40:46 -0500 Subject: [PATCH 1/4] Allow user selection of text in Lovelace Closes https://github.com/home-assistant/home-assistant-polymer/issues/2110 --- src/panels/lovelace/hui-root.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 778007026251..51b8c19347cd 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -282,9 +282,6 @@ class HUIRoot extends LitElement { haStyle, css` :host { - -ms-user-select: none; - -webkit-user-select: none; - -moz-user-select: none; --dark-color: #455a64; --text-dark-color: #fff; } From d0e05e881c0632a5187e0a238ec574b9fbea9556 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Thu, 5 Sep 2019 14:19:24 -0500 Subject: [PATCH 2/4] set negative tabindex This appears to work locally, but pushing it up to try on the demo to be sure --- src/panels/lovelace/hui-root.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 51b8c19347cd..95b9ce3a521f 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -282,6 +282,7 @@ class HUIRoot extends LitElement { haStyle, css` :host { + tabindex: -1, --dark-color: #455a64; --text-dark-color: #fff; } From 38e64f2d45a025d14fa5e922ad02e514c1de05d9 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Mon, 30 Sep 2019 19:54:57 -0500 Subject: [PATCH 3/4] toggle class for android --- src/panels/lovelace/hui-root.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index 95b9ce3a521f..788b1c2498c7 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -71,6 +71,15 @@ class HUIRoot extends LitElement { ); } + protected firstUpdated(changedProperties: PropertyValues): void { + super.firstUpdated(changedProperties); + const userAgent = navigator.userAgent; + + if (userAgent.match(/Android/) && userAgent.match(/Chrome/)) { + this.classList.toggle("disable-text-select", true); + } + } + protected render(): TemplateResult | void { return html`