# Context This PR addresses the solving of the upload image issue. (Fixes #4160) # Cause The `<StyledBlockNoteStyledContainer onClick={() => editor.focus()}>` handler was the origin of the problem, after removing it the issue disappeared, maintaining all the other functionalities. # Outcome _Videos before and after removal:_ https://github.com/twentyhq/twenty/assets/92337535/9d8eb635-4164-4fea-a763-19becabf44ac https://github.com/twentyhq/twenty/assets/92337535/8fedb50f-5306-42ad-be21-58d89ff7d1c7
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
import { ClipboardEvent, useCallback, useMemo } from 'react';
|
import { ClipboardEvent, useCallback, useMemo } from 'react';
|
||||||
import { useApolloClient } from '@apollo/client';
|
import { useApolloClient } from '@apollo/client';
|
||||||
import { useCreateBlockNote } from '@blocknote/react';
|
import { useCreateBlockNote } from '@blocknote/react';
|
||||||
import styled from '@emotion/styled';
|
|
||||||
import { isArray, isNonEmptyString } from '@sniptt/guards';
|
import { isArray, isNonEmptyString } from '@sniptt/guards';
|
||||||
import { useRecoilCallback, useRecoilState } from 'recoil';
|
import { useRecoilCallback, useRecoilState } from 'recoil';
|
||||||
import { Key } from 'ts-key-enum';
|
import { Key } from 'ts-key-enum';
|
||||||
@ -33,11 +32,6 @@ import { getFileType } from '../files/utils/getFileType';
|
|||||||
|
|
||||||
import '@blocknote/react/style.css';
|
import '@blocknote/react/style.css';
|
||||||
|
|
||||||
const StyledBlockNoteStyledContainer = styled.div`
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
`;
|
|
||||||
|
|
||||||
type ActivityBodyEditorProps = {
|
type ActivityBodyEditorProps = {
|
||||||
activityId: string;
|
activityId: string;
|
||||||
fillTitleFromBody: boolean;
|
fillTitleFromBody: boolean;
|
||||||
@ -388,14 +382,12 @@ export const ActivityBodyEditor = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledBlockNoteStyledContainer onClick={() => editor.focus()}>
|
<BlockEditor
|
||||||
<BlockEditor
|
onFocus={handleBlockEditorFocus}
|
||||||
onFocus={handleBlockEditorFocus}
|
onBlur={handlerBlockEditorBlur}
|
||||||
onBlur={handlerBlockEditorBlur}
|
onPaste={handleImagePaste}
|
||||||
onPaste={handleImagePaste}
|
onChange={handleEditorChange}
|
||||||
onChange={handleEditorChange}
|
editor={editor}
|
||||||
editor={editor}
|
/>
|
||||||
/>
|
|
||||||
</StyledBlockNoteStyledContainer>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user