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

redraw breaks primary render #1

Closed
mnichols opened this issue Sep 18, 2017 · 2 comments
Closed

redraw breaks primary render #1

mnichols opened this issue Sep 18, 2017 · 2 comments

Comments

@mnichols
Copy link

I tried using SelfSufficient and it somehow disrupts subsequent render calls on the top-level node.

I spun up a codepen here to demonstrate: https://codepen.io/nicholsmike/pen/pWjGoM?editors=1000.
Notice that clicking the button changes the vnode.attrs.model state but the DOM doesnt update until you move the mouse again (causing another redraw).

ref: MithrilJS/mithril.js#1907

@dead-claudia
Copy link
Owner

Just pushed a fixed file. I added a helper method to help you out, as well as another lifecycle method to avoid related issues.

For event listeners, you'll want to use onclick: this.link(vnode, handler), which basically is an explicit equivalent to what Mithril does implicitly with event handlers when you use m.mount.

@mnichols
Copy link
Author

Thanks @isiahmeadows I'll have a look as soon as I can. Thanks for this!

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

No branches or pull requests

2 participants