Scroll to bottom of conversation on message send
This commit is contained in:
parent
254c87a1ac
commit
5bd7eda124
13 changed files with 107 additions and 21 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue