diff --git a/src/components/views/rooms/SendMessageComposer.js b/src/components/views/rooms/SendMessageComposer.js index 068627455d..673df949f7 100644 --- a/src/components/views/rooms/SendMessageComposer.js +++ b/src/components/views/rooms/SendMessageComposer.js @@ -404,7 +404,9 @@ export default class SendMessageComposer extends React.Component { this._editorRef.clearUndoHistory(); this._editorRef.focus(); this._clearStoredEditorState(); - dis.dispatch({action: "scroll_to_bottom"}); + if (SettingsStore.getValue("scrollToBottomOnMessageSent")) { + dis.dispatch({action: "scroll_to_bottom"}); + } } componentWillUnmount() { diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js index 04fcea39dc..ae9cad4cfa 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js @@ -48,6 +48,7 @@ export default class PreferencesUserSettingsTab extends React.Component { 'showRedactions', 'enableSyntaxHighlightLanguageDetection', 'expandCodeByDefault', + 'scrollToBottomOnMessageSent', 'showCodeLineNumbers', 'showJoinLeaves', 'showAvatarChanges', diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 8abe12c528..063b74c22c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -809,6 +809,7 @@ "Enable automatic language detection for syntax highlighting": "Enable automatic language detection for syntax highlighting", "Expand code blocks by default": "Expand code blocks by default", "Show line numbers in code blocks": "Show line numbers in code blocks", + "Jump to the bottom of the timeline when you send a message": "Jump to the bottom of the timeline when you send a message", "Show avatars in user and room mentions": "Show avatars in user and room mentions", "Enable big emoji in chat": "Enable big emoji in chat", "Send typing notifications": "Send typing notifications", diff --git a/src/settings/Settings.ts b/src/settings/Settings.ts index 43210021e5..4f589ba49a 100644 --- a/src/settings/Settings.ts +++ b/src/settings/Settings.ts @@ -330,6 +330,11 @@ export const SETTINGS: {[setting: string]: ISetting} = { displayName: _td('Show line numbers in code blocks'), default: true, }, + "scrollToBottomOnMessageSent": { + supportedLevels: LEVELS_ACCOUNT_SETTINGS, + displayName: _td('Jump to the bottom of the timeline when you send a message'), + default: true, + }, "Pill.shouldShowPillAvatar": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td('Show avatars in user and room mentions'),