-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
SvelteDate
reactivity issue
#13513
Comments
Most likely #13171 is the culprit. |
I don't think that's the issue...i'm checking and it seems like it's setting the value to the same time. I'm investingating what's this all about |
The problem is not with the |
Interesting, but in class directive it is only accessed once(?). |
Yeah there's definitely something else going on but i don't think it's related to that change. I'm investigating tho. |
Mmm ok the problem with my repl is kinda the same as the |
I think i need to surrender to this one and invoke @trueadm ...from my exploration the problem seems to be that the derived returned from |
This is a simpler (?) reproduction The intermediate derived is probably destroying the children whilst being updated. |
Hello, Even stranger : just adding a |
I think I kinda figure out what's going on. In I literally just figure out this on my phone so I might be wrong and I still can't fix it but I will investigate better |
And this also kinda confirm my theory...because now the derived is not created inside the derived so it's just "a normal derived" |
I logged the derived and it's flags, and your right : after the click the derived inside SvelteDate is marked as |
Yup...which btw is perfectly fine because in userland you can't keep a reference to the derived signal outside of the derived itself so when the derived is invalidated it's fine to destroy each children. However in |
We need to check if the derived in the map has the destroyed flag and if so, create it again |
Setting the current reaction to be the parent of the reaction before creating the derived fixes the problem but I don't know if this has some problem. But this solution seems like a good solution, let me try |
Describe the bug
In a previous issue #12717, I discovered a caching problem which was fixed in 210. Now after updating I am having a similar issue. After some trials, this seems to have been introduced from 246 to 247 and exists in the latest 262.
Reproduction
{date.getMonth() == 1}
expression is moved away from theclass:
, e.g. having the expression as text will not trigger the issue.{date}
as the button text is always unresponsive (This is minor caveat I discovered when trying to reproduce the issue.)Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: