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

@@ -25,6 +25,7 @@ type ButtonProps = {
| TargetedEvent<HTMLFormElement>
| TargetedMouseEvent<HTMLButtonElement>
) => void;
onBlur?: (event: FocusEvent) => void;
disabled?: boolean;
};
@@ -34,6 +35,7 @@ export const Button: FunctionComponent<ButtonProps> = forwardRef(
type,
label,
className = '',
onBlur,
onClick,
disabled = false,
children,
@@ -46,6 +48,7 @@ export const Button: FunctionComponent<ButtonProps> = forwardRef(
return (
<button
className={`${buttonClass} ${cursorClass} ${className}`}
onBlur={onBlur}
onClick={(e) => {
onClick(e);
e.preventDefault();