mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Scroll to bottom of conversation on message send
This commit is contained in:
@@ -61,6 +61,7 @@ export type InputApi = {
|
||||
|
||||
export type Props = {
|
||||
readonly i18n: LocalizerType;
|
||||
readonly conversationId: string;
|
||||
readonly disabled?: boolean;
|
||||
readonly large?: boolean;
|
||||
readonly inputApi?: React.MutableRefObject<InputApi | undefined>;
|
||||
@@ -84,6 +85,7 @@ export type Props = {
|
||||
): unknown;
|
||||
getQuotedMessage(): unknown;
|
||||
clearQuotedMessage(): unknown;
|
||||
scrollToBottom: (converstionId: string) => unknown;
|
||||
};
|
||||
|
||||
const MAX_LENGTH = 64 * 1024;
|
||||
@@ -92,6 +94,7 @@ const BASE_CLASS_NAME = 'module-composition-input';
|
||||
export function CompositionInput(props: Props): React.ReactElement {
|
||||
const {
|
||||
i18n,
|
||||
conversationId,
|
||||
disabled,
|
||||
large,
|
||||
inputApi,
|
||||
@@ -103,6 +106,7 @@ export function CompositionInput(props: Props): React.ReactElement {
|
||||
draftBodyRanges,
|
||||
getQuotedMessage,
|
||||
clearQuotedMessage,
|
||||
scrollToBottom,
|
||||
sortedGroupMembers,
|
||||
} = props;
|
||||
|
||||
@@ -238,6 +242,7 @@ export function CompositionInput(props: Props): React.ReactElement {
|
||||
`CompositionInput: Submitting message ${timestamp} with ${mentions.length} mentions`
|
||||
);
|
||||
onSubmit(text, mentions, timestamp);
|
||||
scrollToBottom(conversationId);
|
||||
};
|
||||
|
||||
if (inputApi) {
|
||||
|
||||
Reference in New Issue
Block a user