-
-
Notifications
You must be signed in to change notification settings - Fork 924
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
Component retains old event listener after its content changes #1613
Comments
Mithril redraws after the Stopping event propagation in the |
Here's a smaller repro: https://jsbin.com/nesehey/8/edit?js,output It attaches a non-mithril attribute to the outer node which persists between both states. Not sure if that's useful, but it is interesting. |
Another argument for #1592 Conspiracy theory: I'm starting to think @lhorie is actually a secret Zalgo priest, luring unsuspecting coders to feed his master. The Zalgo article was mentioned in #1, and Leo is usually convinced by rational arguments, yet, maybe-sync redraws are still there, justified as an optimization, and calls for always async are ignored... Sync redraws win at best 16 ms, 8 on average on platforms that support rAF... UI changes that happen within 100ms are percieved as instantaneous... Incorrect code is infinitely slower, anyway. |
https://codepen.io/ilsenem/pen/JEeYzx?editors=0010 This behavior is not the case in It may be fast redraw as @tivac mentioned. |
He must've been teaming up with this guy at one point! 😆 In reality, I think it took the monster of 0.2 for him to start becoming a little more conservative when it comes to architecting the code. That old code base was almost the epitome of Zalgo. There was enough spaghetti logic to make improvement nearly impossible without breaking everything, over and over and over. (And this is why it wound up with a full revert - it was a read-only code base, where only the slightest change in seemingly unrelated areas caused an entire mountain to topple.) |
As for the current rewrite, I just haven't had the chance to take a decent look at it for performance tweaks. |
@isiahmeadows this particular variant of Zalgo results from a consumer API contract that occasionally deviates from otherwise predictable resolution expectations - specifically: mostly asynchronous but sometimes synchronous. Like the unreliable attempt by |
I'd say that here, Mithril unleashes Zalgo on itself by calling said public API in the event handler... A cheap "fix" would be to |
@v4n if this is blocking you, you can add e.redraw = false
setTimeout(m.redraw) to the problematic handlers |
Found a suspect: this branch should have an |
@isiahmeadows isn't covered here? |
No, but my initial suspicion is wrong. |
The problem is that the inexistence isn't being handled correctly. |
Another suspect: this function should clean up removed attributes as well. |
It's not a 1.1 blocker, though (although it still repros). |
Closing in favor of #1804. |
I have the following component with a
span
that should only callunclick
when it's clicked but callsclick
andunclick
.Here is a running example:
https://codepen.io/v4n/pen/bgQNGW?editors=0010
The text was updated successfully, but these errors were encountered: