Thanks for the detailed repro, much appreciated
This should fix it, see commit description for details:
https://github.com/discourse/discourse/pull/8198
@sam @awesomerobot my recommendation would be to add the type="button"
by default to d-button
component, I added support for type months ago, and I think we should go further than this. It’s so easy to create this kind of unexpected behaviour.