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

Inconsistent state handling inside loops #3007

Open
1 of 7 tasks
Kal-Aster opened this issue May 11, 2024 · 1 comment
Open
1 of 7 tasks

Inconsistent state handling inside loops #3007

Kal-Aster opened this issue May 11, 2024 · 1 comment
Assignees

Comments

@Kal-Aster
Copy link

Help us to manage our issues by answering the following:

  1. Describe your issue:

I noticed sometimes that when I update the component inside a callback inline in the html element it updates correctly but the state object remain unchanged.
Trying to understand what was going on I noticed that this happen when the inline-callback is inside a loop.
See the console.log in the example below.

  1. Can you reproduce the issue?

example repro

  1. On which browser/OS does the issue appear?

Firefox Windows

  1. Which version of Riot does it affect?

Latest

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@GianlucaGuarini
Copy link
Member

Thank you for reporting this issue. This edge case can be only fixed by a major release, I think I could use a proxy instead of cloning the loop context from the parent scope.

I am not sure if switching to a proxy is really a breaking change but I can imagine that some other Riot.js users might have other bugs by introducing this change in a minor release.

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

No branches or pull requests

2 participants