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

UI not updating immediately when the button that is clicked on is removed (bug?) #50

Closed
Dretch opened this issue Dec 23, 2021 · 2 comments
Labels
bug Something isn't working correctly

Comments

@Dretch
Copy link
Contributor

Dretch commented Dec 23, 2021

Hello!

I think this is probably a bug -- it is certainly unexpected:

  • I have a widget that contains a button.
  • When the button is clicked, the state is changed such that the entire widget tree is replaced by a different widget tree.
  • When this happens, the screen goes blank instead of showing the new widget immediately -- this is the bug!
  • However, when the mouse is moved a little, then the new widget appears.

I have attached a modification of the hello-world starter that demonstrates the issue: monomer-ui-not-updating-issue.zip

I guess this is somehow related to the button that is being clicked on being removed, since the issue does not seem to occur if clicking on the button leaves the button as-is but causes a different widget to be replaced.

@Dretch Dretch changed the title UI not updating immediatly when the button that is clicked on is removed (bug?) UI not updating immediately when the button that is clicked on is removed (bug?) Dec 23, 2021
@fjvallarino
Copy link
Owner

This is indeed a bug! It seems I never tested replacing the root element for a widget of a different type. All the applications and examples I created have a Container as the root, and this bug in Composite remained hidden. Just in case you want to test, you can replace:

buildUI wenv = \case

with

buildUI wenv = box . \case

and it will work as expected since it uses the box container as the root.


I pushed a PR fixing the bug in Composite, and your example should now work without changes. To test it, you need to modify your stack.yaml to use this specific commit:

- git: https://github.com/fjvallarino/monomer.git
  commit: 8e3d676e1acf1555c876b19dba9497414d934579

Thanks for reporting this!

@fjvallarino
Copy link
Owner

I'll close the issue for the time being; this changeset will be included in the next release.

Please re-open or create a new one if needed!

@fjvallarino fjvallarino added the bug Something isn't working correctly label Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants