From 18419ed91f188bab8d012d380155203ae96fa427 Mon Sep 17 00:00:00 2001 From: odanado Date: Fri, 31 May 2024 07:23:54 +0900 Subject: [PATCH] [docs] make code samples in component lifecycle consistent (#1338) --- packages/lit-dev-content/site/docs/v2/components/lifecycle.md | 2 +- packages/lit-dev-content/site/docs/v3/components/lifecycle.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lit-dev-content/site/docs/v2/components/lifecycle.md b/packages/lit-dev-content/site/docs/v2/components/lifecycle.md index 1f3abcec4..5a440c9bd 100644 --- a/packages/lit-dev-content/site/docs/v2/components/lifecycle.md +++ b/packages/lit-dev-content/site/docs/v2/components/lifecycle.md @@ -58,7 +58,7 @@ In `connectedCallback()` you should setup tasks that should only occur when the ```js connectedCallback() { super.connectedCallback() - addEventListener('keydown', this._handleKeydown); + window.addEventListener('keydown', this._handleKeydown); } ``` ### disconnectedCallback() {#disconnectedcallback} diff --git a/packages/lit-dev-content/site/docs/v3/components/lifecycle.md b/packages/lit-dev-content/site/docs/v3/components/lifecycle.md index e8f5333a1..c2484ece4 100644 --- a/packages/lit-dev-content/site/docs/v3/components/lifecycle.md +++ b/packages/lit-dev-content/site/docs/v3/components/lifecycle.md @@ -58,7 +58,7 @@ In `connectedCallback()` you should setup tasks that should only occur when the ```js connectedCallback() { super.connectedCallback() - addEventListener('keydown', this._handleKeydown); + window.addEventListener('keydown', this._handleKeydown); } ``` ### disconnectedCallback() {#disconnectedcallback}