mithril.js icon indicating copy to clipboard operation
mithril.js copied to clipboard

Update component when clicking anchor

Open yueduz opened this issue 5 years ago • 8 comments

[email protected]

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 = ""

yueduz avatar Dec 16 '19 09:12 yueduz

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.

pygy avatar Dec 16 '19 18:12 pygy

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?

ChrisGitIt avatar Dec 17 '19 15:12 ChrisGitIt

Yeah, onclick: e => e.redraw = false would work.

osban avatar Dec 18 '19 14:12 osban

@pygy Could you link to that discussion?

dead-claudia avatar Dec 19 '19 06:12 dead-claudia

大家好,“ 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

yueduz avatar Dec 19 '19 07:12 yueduz

@isiahmeadows See #1270 (and also #1088 for a counter-argument)

pygy avatar Dec 23 '19 22:12 pygy

won't fix for me

StephanHoyer avatar Mar 01 '22 07:03 StephanHoyer

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

StephanHoyer avatar Mar 01 '22 07:03 StephanHoyer