Mithril version:
Platform and OS:
Project:
Is this something you're interested in implementing yourself?
Description
m.capture = event => {
event.preventDefault()
event.stopPropagation()
}
And also remove the return value handling logic from this section.
Why
I want to see this idiom die, just as it's largely died elsewhere:
m("button", {
onclick() {
doStuff()
return false
}
}, "bottom text")
Also, it's not compatible with async functions as event handlers.
m("button", {
async onclick() {
await doStuff()
return false // Doesn't work like it looks like it does!
}
}, "bottom text")
Oh, and it'll likely result in a small but measurable net reduction in size compared to what we already do to support return false.
Possible Implementation
See description.
Open Questions
I think the real discussion is should we continue to support the return false that standards bodies have effectively declared as legacy?
Mithril version:
Platform and OS:
Project:
Is this something you're interested in implementing yourself?
Description
And also remove the return value handling logic from this section.
Why
I want to see this idiom die, just as it's largely died elsewhere:
Also, it's not compatible with async functions as event handlers.
Oh, and it'll likely result in a small but measurable net reduction in size compared to what we already do to support
return false.Possible Implementation
See description.
Open Questions
I think the real discussion is should we continue to support the
return falsethat standards bodies have effectively declared as legacy?