mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Monkey patch for bug in safari 14 (#7031)
This commit is contained in:
parent
854a54e9c6
commit
b7d7ca4014
@ -1,3 +1,4 @@
|
|||||||
|
import "../../../src/resources/safari-14-attachshadow-patch";
|
||||||
import "../../../src/resources/ha-style";
|
import "../../../src/resources/ha-style";
|
||||||
import "../../../src/resources/roboto";
|
import "../../../src/resources/roboto";
|
||||||
import "./layout/hc-connect";
|
import "./layout/hc-connect";
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import "../../src/resources/safari-14-attachshadow-patch";
|
||||||
import "@polymer/polymer/lib/elements/dom-if";
|
import "@polymer/polymer/lib/elements/dom-if";
|
||||||
import "@polymer/polymer/lib/elements/dom-repeat";
|
import "@polymer/polymer/lib/elements/dom-repeat";
|
||||||
import "../../src/resources/ha-style";
|
import "../../src/resources/ha-style";
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import "../../src/resources/compatibility";
|
import "../../src/resources/compatibility";
|
||||||
|
import "../../src/resources/safari-14-attachshadow-patch";
|
||||||
import "../../src/resources/roboto";
|
import "../../src/resources/roboto";
|
||||||
import "./hassio-main";
|
import "./hassio-main";
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// Compat needs to be first import
|
// Compat needs to be first import
|
||||||
import "../resources/compatibility";
|
import "../resources/compatibility";
|
||||||
|
import "../resources/safari-14-attachshadow-patch";
|
||||||
import "@polymer/polymer/lib/elements/dom-if";
|
import "@polymer/polymer/lib/elements/dom-if";
|
||||||
import "@polymer/polymer/lib/elements/dom-repeat";
|
import "@polymer/polymer/lib/elements/dom-repeat";
|
||||||
import "../auth/ha-authorize";
|
import "../auth/ha-authorize";
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// Compat needs to be first import
|
// Compat needs to be first import
|
||||||
import "../resources/compatibility";
|
import "../resources/compatibility";
|
||||||
|
import "../resources/safari-14-attachshadow-patch";
|
||||||
import {
|
import {
|
||||||
Auth,
|
Auth,
|
||||||
Connection,
|
Connection,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import "../resources/compatibility";
|
import "../resources/compatibility";
|
||||||
|
import "../resources/safari-14-attachshadow-patch";
|
||||||
import { PolymerElement } from "@polymer/polymer";
|
import { PolymerElement } from "@polymer/polymer";
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import { loadJS } from "../common/dom/load_resource";
|
import { loadJS } from "../common/dom/load_resource";
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
// Compat needs to be first import
|
// Compat needs to be first import
|
||||||
import "../resources/compatibility";
|
import "../resources/compatibility";
|
||||||
|
import "../resources/safari-14-attachshadow-patch";
|
||||||
import "../onboarding/ha-onboarding";
|
import "../onboarding/ha-onboarding";
|
||||||
import "../resources/ha-style";
|
import "../resources/ha-style";
|
||||||
import "../resources/roboto";
|
import "../resources/roboto";
|
||||||
|
13
src/resources/safari-14-attachshadow-patch.ts
Normal file
13
src/resources/safari-14-attachshadow-patch.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// https://github.com/home-assistant/frontend/pull/7031
|
||||||
|
const isSafari14 = /^((?!chrome|android).)*version\/14\.0.*safari/i.test(
|
||||||
|
navigator.userAgent
|
||||||
|
);
|
||||||
|
if (isSafari14) {
|
||||||
|
const origAttachShadow = window.Element.prototype.attachShadow;
|
||||||
|
window.Element.prototype.attachShadow = function (init) {
|
||||||
|
if (init && init.delegatesFocus) {
|
||||||
|
delete init.delegatesFocus;
|
||||||
|
}
|
||||||
|
return origAttachShadow.apply(this, [init]);
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user