fix: file popover not closing when click inside editor (#924)

This commit is contained in:
Aman Harwara
2022-03-14 17:30:15 +05:30
committed by GitHub
parent 7e67061097
commit 89c4b9a9f8
4 changed files with 32 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ export type PopoverFileItemProps = {
isAttachedToNote: boolean;
handleFileAction: (action: PopoverFileItemAction) => Promise<boolean>;
getIconType(type: string): IconType;
closeOnBlur: (event: { relatedTarget: EventTarget | null }) => void;
};
export const PopoverFileItem: FunctionComponent<PopoverFileItemProps> = ({
@@ -28,6 +29,7 @@ export const PopoverFileItem: FunctionComponent<PopoverFileItemProps> = ({
isAttachedToNote,
handleFileAction,
getIconType,
closeOnBlur,
}) => {
const [fileName, setFileName] = useState(file.name);
const [isRenamingFile, setIsRenamingFile] = useState(false);
@@ -93,6 +95,7 @@ export const PopoverFileItem: FunctionComponent<PopoverFileItemProps> = ({
isAttachedToNote={isAttachedToNote}
handleFileAction={handleFileAction}
setIsRenamingFile={setIsRenamingFile}
closeOnBlur={closeOnBlur}
/>
</div>
);