From b8a1d7a8b6a4ab323fe504b4fa0d0d50a004977c Mon Sep 17 00:00:00 2001 From: Tal Hadad Date: Mon, 25 Jul 2022 23:35:58 +0300 Subject: [PATCH 1/2] use `Node.parentNode` instead `Node.parentElement` in `dom.ts`. This is for a simple legacy browsers compatibility (specifically, IE11). --- src/runtime/internal/dom.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 072506629c1..8436e599e60 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -163,7 +163,8 @@ export function append_hydration(target: NodeEx, node: NodeEx) { if (is_hydrating) { init_hydrate(target); - if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentElement !== target))) { + // Note: It is important to use `Node.parentNode` instead `Node.parentElement` for a simple legacy browsers compatibility. + if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) { target.actual_end_child = target.firstChild; } From c1a6c18e9098a950f2cc75dfbbbf04854faf5b16 Mon Sep 17 00:00:00 2001 From: Tal500 Date: Thu, 28 Jul 2022 18:57:03 +0300 Subject: [PATCH 2/2] remove the comment in src/runtime/internal/dom.ts It could be noisy. Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> --- src/runtime/internal/dom.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 8436e599e60..8a7d3af6da3 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -163,7 +163,6 @@ export function append_hydration(target: NodeEx, node: NodeEx) { if (is_hydrating) { init_hydrate(target); - // Note: It is important to use `Node.parentNode` instead `Node.parentElement` for a simple legacy browsers compatibility. if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) { target.actual_end_child = target.firstChild; }