FIX: navigate to topic/PM regardless of Shift key press (#15551)

Currently when pressing Shift key and hitting Reply button the user
stays on the post they are on and does not get navigated to newly
created topic/PM/reply. This is fine for replies but creates confusion
when composing a new topic/PM.

This commits makes it such that pressing Shift key and Reply button
(or ctrl-shift-enter / cmd-shift-enter) works only for replies and not
for new topic/PM. The user will always be navigated to new topic/PM.
This commit is contained in:
Arpit Jalan 2022-01-13 02:43:33 +05:30 committed by GitHub
parent 2c7906999a
commit c593727497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -632,7 +632,9 @@ export default Controller.extend({
save(ignore, event) {
this.save(false, {
jump: !event?.shiftKey && !this.skipJumpOnSave,
jump:
!(event?.shiftKey && this.get("model.replyingToTopic")) &&
!this.skipJumpOnSave,
});
},