mithril.js
mithril.js copied to clipboard
Update component when clicking anchor
Chromium and Linux
mithril updated the component when I clicked on the anchor. I think doing nothing but scrolling the page is the correct behavior.
I have done the following settings
m.route.prefix = ""
IIRC I already shared your assessment around the v1.0 release, but Leo disagreed and he was still running the show.
We can probably revisit this.
Hi everybody, isn't this a case for "ev.preventDefault()" or m.redraw = false?
@yueduz: What exactly are you doing? What is "the anchor"? You mean a named anchor?
Yeah, onclick: e => e.redraw = false
would work.
@pygy Could you link to that discussion?
大家好,“ ev.preventDefault()”或m.redraw = false是否不是这种情况?
@yueduz:您到底在做什么?什么是“锚”?你是说一个命名的锚?
Is a link containing a "#": https://blog.juying.co/content/Linux%E4%B8%8B%E4%BD%BF%E7%94%A8Mac%E9%94%AE%E7%BB%91%E5%AE%9A%E9%A3%8E%E6%A0%BC#%E5%BA%9F%E8%AF%9D%E8%AF%B4%E5%AE%8C%E4%BA%86%EF%BC%8C%E6%88%91%E4%BB%AC%E5%BC%80%E5%A7%8B
@isiahmeadows See #1270 (and also #1088 for a counter-argument)
won't fix for me
From the admin-channel by @dead-claudia
@StephanHoyer MithrilJS/mithril.js#2555 is probably worth fixing IMHO - I still stand with my comment in MithrilJS/mithril.js#1088. In general, we should only redraw on changes to the parts of the route that impact routing. Pathname: path + query Query: query only Hash: hash only I wouldn't count it as a release blocker, though, especially considering it's potentially breaking and best held for v3.
I'm ok with that