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

Should redraw on hash change when m.route.mode is pathname #1088

Closed
sebastiansandqvist opened this issue Jun 2, 2016 · 1 comment
Closed

Comments

@sebastiansandqvist
Copy link
Contributor

My application uses pathname for routing, but can also depend on the hash (for example, to display a specific modal).

Normal cases where users click a component in the ui in order to trigger the hash change are fine since the onclick handler causes a redraw. However, when using the browser's back/forward buttons no redraw occurs. I can manually get the functionality I am looking for by setting window.onhashchange to m.redraw, but I think a check for this would make sense within the library itself.

I am using mithril version 0.2.4.

@dead-claudia
Copy link
Member

I'd rather not build that in. It's pointless to redraw on hash change if you're displaying a more static page with named anchors you want to reference. In that case, you would prefer to leave everything untouched, and a redraw would be a waste of time, and it could disrupt the page's eventual jump to the hash.

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