This commit is contained in:
Florian Duros
2022-10-13 16:46:47 +02:00
parent a96aea29a9
commit ac8397aa0f
6 changed files with 20 additions and 18 deletions

View File

@@ -26,7 +26,7 @@ export const Editor = memo(
) {
return <div className="mx_WysiwygComposer_container">
<div className="mx_WysiwygComposer_content"
ref={ref}
ref={ref!}
contentEditable={!disabled}
role="textbox"
aria-multiline="true"

View File

@@ -44,10 +44,10 @@ export function WysiwygComposer(
const { ref, isWysiwygReady, content, formattingStates, wysiwyg } = useWysiwyg();
useEffect(() => {
if (content !== null) {
if (!disabled && content !== null) {
onChange(content);
}
}, [onChange, content]);
}, [onChange, content, disabled]);
const memoizedSendMessage = useCallback(() => {
sendMessage(content, { mxClient, roomContext, ...props });