Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load and set Polymer settings asynchronously #18278

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hassio/src/entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Compat needs to be first import
import "../../src/resources/compatibility";
import { setCancelSyntheticClickEvents } from "@polymer/polymer/lib/utils/settings";
import "../../src/resources/safari-14-attachshadow-patch";
import "./hassio-main";

import("../../src/resources/ha-style");

setCancelSyntheticClickEvents(false);
import("@polymer/polymer/lib/utils/settings").then(
({ setCancelSyntheticClickEvents }) => setCancelSyntheticClickEvents(false)
);

const styleEl = document.createElement("style");
styleEl.textContent = `
Expand Down
13 changes: 6 additions & 7 deletions src/entrypoints/app.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {
setPassiveTouchGestures,
setCancelSyntheticClickEvents,
} from "@polymer/polymer/lib/utils/settings";
import "@webcomponents/scoped-custom-element-registry/scoped-custom-element-registry.min";
import "../layouts/home-assistant";

import("../resources/ha-style");

setPassiveTouchGestures(true);
setCancelSyntheticClickEvents(false);
import("@polymer/polymer/lib/utils/settings").then(
({ setCancelSyntheticClickEvents, setPassiveTouchGestures }) => {
setCancelSyntheticClickEvents(false);
setPassiveTouchGestures(true);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being set anyway when preventDefault() is called all over the place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are mostly for click action and other events, not for touch events

);
6 changes: 3 additions & 3 deletions src/entrypoints/authorize.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Compat needs to be first import
import "../resources/compatibility";
import { setCancelSyntheticClickEvents } from "@polymer/polymer/lib/utils/settings";
import "../auth/ha-authorize";
import "../resources/safari-14-attachshadow-patch";
import "../resources/array.flat.polyfill";

import("../resources/ha-style");

setCancelSyntheticClickEvents(false);
import("@polymer/polymer/lib/utils/settings").then(
({ setCancelSyntheticClickEvents }) => setCancelSyntheticClickEvents(false)
);
5 changes: 3 additions & 2 deletions src/entrypoints/custom-panel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Compat needs to be first import
import "../resources/compatibility";
import { setCancelSyntheticClickEvents } from "@polymer/polymer/lib/utils/settings";
import "../resources/safari-14-attachshadow-patch";

import { PolymerElement } from "@polymer/polymer";
Expand All @@ -16,7 +15,9 @@ import { createCustomPanelElement } from "../util/custom-panel/create-custom-pan
import { loadCustomPanel } from "../util/custom-panel/load-custom-panel";
import { setCustomPanelProperties } from "../util/custom-panel/set-custom-panel-properties";

setCancelSyntheticClickEvents(false);
import("@polymer/polymer/lib/utils/settings").then(
({ setCancelSyntheticClickEvents }) => setCancelSyntheticClickEvents(false)
);

declare global {
interface Window {
Expand Down
6 changes: 3 additions & 3 deletions src/entrypoints/onboarding.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Compat needs to be first import
import "../resources/compatibility";
import { setCancelSyntheticClickEvents } from "@polymer/polymer/lib/utils/settings";
import "../onboarding/ha-onboarding";
import "../resources/safari-14-attachshadow-patch";
import "../resources/array.flat.polyfill";

import("../resources/ha-style");

setCancelSyntheticClickEvents(false);
import("@polymer/polymer/lib/utils/settings").then(
({ setCancelSyntheticClickEvents }) => setCancelSyntheticClickEvents(false)
);

declare global {
interface Window {
Expand Down
Loading