Clean up inviteLink handling, harden compose input
This commit is contained in:
parent
986d8a66bc
commit
fc12d02a8d
12 changed files with 59 additions and 3 deletions
|
@ -76,6 +76,7 @@ export type Props = {
|
|||
onSubmit(message: string, mentions: Array<BodyRangeType>): unknown;
|
||||
getQuotedMessage(): unknown;
|
||||
clearQuotedMessage(): unknown;
|
||||
setSecureInput(enabled: boolean): unknown;
|
||||
};
|
||||
|
||||
const MAX_LENGTH = 64 * 1024;
|
||||
|
@ -103,6 +104,7 @@ export const CompositionInput: React.ComponentType<Props> = props => {
|
|||
skinTone,
|
||||
draftText,
|
||||
draftBodyRanges,
|
||||
setSecureInput,
|
||||
getQuotedMessage,
|
||||
clearQuotedMessage,
|
||||
sortedGroupMembers,
|
||||
|
@ -259,6 +261,20 @@ export const CompositionInput: React.ComponentType<Props> = props => {
|
|||
return false;
|
||||
};
|
||||
|
||||
const onFocus = (): void => {
|
||||
setSecureInput(true);
|
||||
};
|
||||
|
||||
const onBlur = (): void => {
|
||||
setSecureInput(false);
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
return () => {
|
||||
setSecureInput(false);
|
||||
};
|
||||
}, [setSecureInput]);
|
||||
|
||||
const onEnter = (): boolean => {
|
||||
const quill = quillRef.current;
|
||||
const emojiCompletion = emojiCompletionRef.current;
|
||||
|
@ -494,6 +510,8 @@ export const CompositionInput: React.ComponentType<Props> = props => {
|
|||
onChange,
|
||||
onEnter,
|
||||
onEscape,
|
||||
onFocus,
|
||||
onBlur,
|
||||
onPickEmoji,
|
||||
onShortKeyEnter,
|
||||
onTab,
|
||||
|
@ -508,6 +526,8 @@ export const CompositionInput: React.ComponentType<Props> = props => {
|
|||
return (
|
||||
<ReactQuill
|
||||
className="module-composition-input__quill"
|
||||
onFocus={() => callbacksRef.current.onFocus()}
|
||||
onBlur={() => callbacksRef.current.onBlur()}
|
||||
onChange={() => callbacksRef.current.onChange()}
|
||||
defaultValue={delta}
|
||||
modules={{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue