FEATURE: CTRL-SHIFT-ENTER and SHIFT-Click do not scroll on post (PR #10939)

This allows for an advanced feature where hitting control on click or CTRL-SHIFT-ENTER will lead to a post being made but the browser not to scroll to the end.

GitHub

@eviltrout / @jjaffeux this works perfectly I think, but is somewhat awkward … any suggestions for cleanup here.

The gist is that if you SHIFT click while replying we do not scroll. Keyboard shortcut is the most awkward but passing of click handler is also a bit awkward.

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/will-disable-jump-reply-make-a-return/116558/61

no optional chaining yet :slight_smile: sorry

Generally speaking I think passing the event is the thing to do, I do this for select-kit everywhere too. If you don’t do this you end up with cases where you are stuck. So I :+1: doing this.

we can’t change this sadly, but this is a very bad name for action, onSave would be much better :confused:

It’s also annoying we have an action and a fn named the same, because this kind of things will cause issue when we move to @action it would just be a regular fn, and we can’t have:

@action
save() (}

save() {}

shouldn’t we pass the event here too ?

maybe we just go with save(force, options = {}) so we don’t have to use optional chaining

And yes I would argue the shortcut is annoying because it’s kinda hard to do ctrl+shift+enter while clicking

Oh it’s only shift click

Or

Ctrl shift enter

Not a mix

maybe we rename / deprecate?

I don’t think so, this is deprecated, I don’t want to support it anymore.

Just pushed some refinements … how is it looking now @jjaffeux ?

I had to revert this because it broke stuff:

https://github.com/discourse/discourse/pull/10959/commits/38632f0ffd956e4c7b7d296955f10eae5e13f6dd

I think passing the event is generally not a bad thing to do, but we have to figure out a way to make it a non-breaking change.