Skip to content

Conversation

@RobertGlobant20
Copy link
Contributor

Purpose

Fix for loading the SplashScreen in Dynamo at startup
When trying to load the splash screen in Dynamo was showing a blank screen, the problem was that due that the javascript code is inserted on runtime when loading the html page in WebView2 the javascript code was not finding the element "root", once I moved the root

above the <script> tag started to work correctly.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Release Notes

Fix for loading the SplashScreen in Dynamo at startup

Reviewers

@QilongTang

FYIs

When trying to load the splash screen in Dynamo was showing a blank screen, the problem was that due that the javascript code is inserted on runtime when loading the html page in WebView2 the javascript code was not finding the element "root", once I moved the root <div> above the <script> tag started to work correctly.
</script>
<script>mainJs</script>
<div id="root"></div>
<script>mainJs</script>
Copy link
Contributor

Choose a reason for hiding this comment

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

oh I did not know it would be as simple as this since I checked this file as well.. why do we need to move this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@QilongTang the mainJS text is replaced on runtime by .NET when loading in WebView2, so in runtime React (js) is trying to find the "root" element inside the html but is not found due that was declared after the <script> tag so just moving the root element one level up will fix the problem.
This is the React code trying to find the root:
image

@RobertGlobant20
Copy link
Contributor Author

GIF 1 showing SplashScreen loading in Dynamo
SplashScreenWorking2

@RobertGlobant20
Copy link
Contributor Author

GIF 2 showing SplashScreen loading in Dynamo
SplashScreenWorking

@QilongTang
Copy link
Contributor

Hi @RobertGlobant20 Please also increase the version of this package

Updating the package version
@RobertGlobant20
Copy link
Contributor Author

RobertGlobant20 commented Oct 20, 2022

Hi @RobertGlobant20 Please also increase the version of this package
version update in the next commit: 6f08721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants