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

Events propagation fails with hot reloaded templates #2481

Closed
1 of 3 tasks
samtay opened this issue Jun 6, 2024 · 0 comments · Fixed by #2484
Closed
1 of 3 tasks

Events propagation fails with hot reloaded templates #2481

samtay opened this issue Jun 6, 2024 · 0 comments · Fixed by #2484
Assignees
Labels
bug Something isn't working core relating to the core implementation of the virtualdom fullstack related to the fullstack crate hot-reload Related to the hot reload crate

Comments

@samtay
Copy link
Contributor

samtay commented Jun 6, 2024

Problem

I couldn't think of a better title. I've found some really strange Schrodinger-esque behavior on main. I have a modal that can be dismissed when you click on the backdrop area, while the modal content has an event.stop_propagation() call so that you can click within the modal without dismissing it.

I found that it only worked the first time the modal was rendered. After the first time, if I opened the modal back up, it would dismiss when I clicked on the inner modal contents (that is, the stop propagation was no longer working).

The really interesting part is that the problem goes away if I include tracing::debug!("blah"); statements 🙃

Steps To Reproduce

Steps to reproduce the behavior:

  • I created a repo where you can see this in action: https://github.com/samtay/repro-modal-bug/commits/main/
  • Check out the second commit to see the problematic behavior; the modal will only work once.
  • Check out the third commit, which just uncomments logging statements, and notice the problem goes away!
  • Note: I believe this is fullstack specific, the problem seems to go away on web.

Expected behavior

It should just work without logging statements of course.

Environment:

  • Dioxus version: main
  • Rust version: 1.78.0
  • OS info: Linux
  • App platform: fullstack

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@ealmloff ealmloff added bug Something isn't working core relating to the core implementation of the virtualdom fullstack related to the fullstack crate hot-reload Related to the hot reload crate labels Jun 6, 2024
@ealmloff ealmloff self-assigned this Jun 6, 2024
@ealmloff ealmloff changed the title Event propagation breaks without logging statements Events propagation fails with hot reloaded templates Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core relating to the core implementation of the virtualdom fullstack related to the fullstack crate hot-reload Related to the hot reload crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants