Skip to content

Commit

Permalink
fix(CommentView): disable edit comment on double-click
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorGoryany committed Jul 18, 2024
1 parent fe4ad14 commit 251f1de
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/components/CommentView/CommentView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,6 @@ export const CommentView: FC<CommentViewProps> = ({

const canEdit = Boolean(onSubmit);

const onCommentDoubleClick = useCallback<React.MouseEventHandler>((e) => {
if (e.detail === 2) {
setEditMode(true);
setFocused(true);
}
}, []);

const onCommentSubmit = useCallback(
async (form: CommentSchema) => {
setEditMode(false);
Expand Down Expand Up @@ -210,11 +203,7 @@ export const CommentView: FC<CommentViewProps> = ({
}
/>
) : (
<Card
className={cn(s.CommentCard, { [s.CommentCard_highlighted]: highlight })}
onClick={canEdit ? onCommentDoubleClick : undefined}
{...headerColors}
>
<Card className={cn(s.CommentCard, { [s.CommentCard_highlighted]: highlight })} {...headerColors}>
<CardInfo onClick={onDateViewTypeChange} className={s.CardInfo} corner>
{nullable(author, (data) => (
<CommentViewHeader
Expand Down

0 comments on commit 251f1de

Please sign in to comment.