fix: Reduce clickable area on star in document header, make entire line clickable to focus title

closes #2966
This commit is contained in:
Tom Moor
2022-01-22 18:25:06 -08:00
parent e8c88b3c33
commit 37a29934ec
2 changed files with 17 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import styled from "styled-components";
type Props = Omit<React.HTMLAttributes<HTMLSpanElement>, "ref" | "onChange"> & {
disabled?: boolean;
readOnly?: boolean;
onClick?: React.MouseEventHandler<HTMLDivElement>;
onChange?: (text: string) => void;
onBlur?: React.FocusEventHandler<HTMLSpanElement> | undefined;
onInput?: React.FormEventHandler<HTMLSpanElement> | undefined;
@@ -36,6 +37,7 @@ const ContentEditable = React.forwardRef(
placeholder,
readOnly,
dir,
onClick,
...rest
}: Props,
forwardedRef: React.RefObject<HTMLSpanElement>
@@ -80,7 +82,7 @@ const ContentEditable = React.forwardRef(
}, [value, ref]);
return (
<div className={className} dir={dir}>
<div className={className} dir={dir} onClick={onClick}>
<Content
ref={ref}
contentEditable={!disabled && !readOnly}