From 7b6e8f5cfbd47147d15557d63879bf1f76985d84 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:15:34 -0500 Subject: [PATCH] Patch Blazor interaction with the DOM (#22491) --- aspnetcore/blazor/javascript-interoperability/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/blazor/javascript-interoperability/index.md b/aspnetcore/blazor/javascript-interoperability/index.md index 5015f261ea..ce8937dea6 100644 --- a/aspnetcore/blazor/javascript-interoperability/index.md +++ b/aspnetcore/blazor/javascript-interoperability/index.md @@ -20,7 +20,7 @@ This overview article covers general concepts. Further JS interop guidance is pr ## Interaction with the Document Object Model (DOM) -Only mutate the Document Object Model (DOM) with JavaScript (JS) when the object doesn't interact with Blazor. Blazor maintains representations of the DOM and interacts directly with DOM objects. If JS interop mutates an element or its content and Blazor attempts to apply diffs to the element, the diffs won't match the DOM and undefined behavior results. Arbitrary behaviors may merely interfere with the presentation of elements or their behavior but may also introduce security risks to the app or server. +Only mutate the Document Object Model (DOM) with JavaScript (JS) when the object doesn't interact with Blazor. Blazor maintains representations of the DOM and interacts directly with DOM objects. If an element rendered by Blazor is modified externally using JS directly or via JS Interop, the DOM may no longer match Blazor's internal representation, which can result in undefined behavior. Undefined behavior may merely interfere with the presentation of elements or their functions but may also introduce security risks to the app or server. This guidance not only applies to your own JS interop code but also to any JS libraries that the app uses, including anything provided by a third-party framework, such as [Bootstrap JS](https://getbootstrap.com/) and [jQuery](https://jquery.com/).