Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View update not working on windows #268

Open
TitusRie opened this issue Jul 21, 2022 · 1 comment
Open

View update not working on windows #268

TitusRie opened this issue Jul 21, 2022 · 1 comment

Comments

@TitusRie
Copy link

When running the RideTheComet app generated with the Comet template the label disappears after clicking the button.

Before clicking the button:
afbeelding

After clicking the button:
afbeelding

(also seems a problem with the rendering after resizing the window, see issue: #267)

I'm using version 0.3.464-beta with Visual Studio 17.3.0 Preview 4.0

Way to reproduce:

  • dotnet new --install Clancey.Comet.Templates.Multiplatform::0.4.344-beta
  • dotnet new comet -n RideTheComet
  • Run project in Visual Studio
  • Click button

Workaround:
Somehow it works to change the line:
new Button("Ride the Comet! ☄️", ()=>{
to:
new Button("Ride the Comet! ☄️" + comet.CometTrain, ()=>{

Somehow this forces the update and shows the label again.
As it also fixes the rendering problem, I get the impression that the label is somehow hidden through rendering problems as mentioned in #267

@Mooshua
Copy link

Mooshua commented Aug 6, 2022

I found that putting comet.Rides += 0; at the top of the body() function fixed it.

I believe all required state must be used in the function in order for it to render properly. Interestingly, the Live XAML view seemed to reflect the changes despite them not being rendered. I believe this is due to the OnPropertyRead system in StateManager not detecting reads in code present inside of the lambda. This obviously does not seem like it's intentional behavior since it's the exact same behavior defined in the examples.

Edit: Hmm. It seems that certain reloads (ones that call ResetView) seem to cause the bug. Adding the line:
State.AddGlobalProperty((page.comet, "")); to my setup code seemed to solve this issue too. I don't know enough about Comet's internals to really diagnose this, but it looks like an issue where ResetView causes some things to get lost in transit (possibly a flawed Diff function???)

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

No branches or pull requests

2 participants