From 5615f59925592800b1b841496145f2e48859b938 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 19 Jul 2023 09:48:37 -0700 Subject: [PATCH 1/3] Clarify API docs for OnAfterRender --- src/Components/Components/src/ComponentBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Components/Components/src/ComponentBase.cs b/src/Components/Components/src/ComponentBase.cs index e0150ec3dc62..3671a55219e0 100644 --- a/src/Components/Components/src/ComponentBase.cs +++ b/src/Components/Components/src/ComponentBase.cs @@ -124,7 +124,8 @@ protected virtual bool ShouldRender() => true; /// - /// Method invoked after each time the component has been rendered. + /// Method invoked after each time the component has been rendered interactively. This method is not + /// invoked during prerendering or server-side rendering. /// /// /// Set to true if this is the first time has been invoked @@ -141,7 +142,8 @@ protected virtual void OnAfterRender(bool firstRender) } /// - /// Method invoked after each time the component has been rendered. Note that the component does + /// Method invoked after each time the component has been rendered interactively. This method is not + /// invoked during prerendering or server-side rendering. Note that the component does /// not automatically re-render after the completion of any returned , because /// that would cause an infinite render loop. /// From 5a3701c48cc7dda573bbb70b4c19ac488a94bb4d Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 28 Jul 2023 09:16:55 -0700 Subject: [PATCH 2/3] Update src/Components/Components/src/ComponentBase.cs Co-authored-by: Steve Sanderson --- src/Components/Components/src/ComponentBase.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Components/Components/src/ComponentBase.cs b/src/Components/Components/src/ComponentBase.cs index 3671a55219e0..bc8b67504090 100644 --- a/src/Components/Components/src/ComponentBase.cs +++ b/src/Components/Components/src/ComponentBase.cs @@ -124,8 +124,12 @@ protected virtual bool ShouldRender() => true; /// - /// Method invoked after each time the component has been rendered interactively. This method is not - /// invoked during prerendering or server-side rendering. + /// Method invoked after each time the component has rendered interactively and the UI has finished + /// updating (for example, after elements have been added to the browser DOM). Any + /// fields will be populated by the time this runs. + /// + /// This method is not invoked during prerendering or server-side rendering, because those processes + /// are not attached to any live browser DOM and are already complete before the DOM is updated. /// /// /// Set to true if this is the first time has been invoked From 6451094fe7aa0083ea753e10d2b7b4667c2e403c Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 28 Jul 2023 09:22:16 -0700 Subject: [PATCH 3/3] Update src/Components/Components/src/ComponentBase.cs --- src/Components/Components/src/ComponentBase.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Components/Components/src/ComponentBase.cs b/src/Components/Components/src/ComponentBase.cs index bc8b67504090..1b3896a77c9c 100644 --- a/src/Components/Components/src/ComponentBase.cs +++ b/src/Components/Components/src/ComponentBase.cs @@ -146,10 +146,15 @@ protected virtual void OnAfterRender(bool firstRender) } /// - /// Method invoked after each time the component has been rendered interactively. This method is not - /// invoked during prerendering or server-side rendering. Note that the component does - /// not automatically re-render after the completion of any returned , because - /// that would cause an infinite render loop. + /// Method invoked after each time the component has been rendered interactively and the UI has finished + /// updating (for example, after elements have been added to the browser DOM). Any + /// fields will be populated by the time this runs. + /// + /// This method is not invoked during prerendering or server-side rendering, because those processes + /// are not attached to any live browser DOM and are already complete before the DOM is updated. + /// + /// Note that the component does not automatically re-render after the completion of any returned , + /// because that would cause an infinite render loop. /// /// /// Set to true if this is the first time has been invoked