mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +00:00
Allow user selection of text in Lovelace (#3605)
* Allow user selection of text in Lovelace Closes https://github.com/home-assistant/home-assistant-polymer/issues/2110 * set negative tabindex This appears to work locally, but pushing it up to try on the demo to be sure * toggle class for android * apply suggestions
This commit is contained in:
parent
8b6d8f9086
commit
76d3218130
@ -73,6 +73,14 @@ class HUIRoot extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues): void {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
this.classList.toggle(
|
||||||
|
"disable-text-select",
|
||||||
|
/Chrome/.test(navigator.userAgent) && /Android/.test(navigator.userAgent)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
<app-route .route="${this.route}" pattern="/:view" data="${
|
<app-route .route="${this.route}" pattern="/:view" data="${
|
||||||
@ -298,11 +306,14 @@ class HUIRoot extends LitElement {
|
|||||||
haStyle,
|
haStyle,
|
||||||
css`
|
css`
|
||||||
:host {
|
:host {
|
||||||
|
--dark-color: #455a64;
|
||||||
|
--text-dark-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host(.disable-text-select) {
|
||||||
-ms-user-select: none;
|
-ms-user-select: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
--dark-color: #455a64;
|
|
||||||
--text-dark-color: #fff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-app-layout {
|
ha-app-layout {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user