Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
fix: Comment, Reply 컴포넌트에 이벤트 전파를 막는다 (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seozi authored Jun 30, 2020
1 parent d27774d commit 16ec27a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Comment/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { PureComponent, ReactElement, ReactNode } from 'react';
import styled from 'styled-components';

import { Caption1, Caption2 } from '../../core';
import { gray500, orange600 } from '../../core/Colors';
import { Avatar, AvatarProps, AvatarSize } from '../Avatar';
Expand Down Expand Up @@ -141,6 +142,7 @@ export class Comment extends PureComponent<CommentProps> {
}

private preventPropagation: React.MouseEventHandler<HTMLDivElement> = event => {
event.preventDefault();
event.stopPropagation();
};
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Reply/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { ReactElement, ReactNode, useCallback, useMemo, useState } from 'react';
import styled from 'styled-components';

import { BreakPoints, Caption1, Caption2 } from '../../core';
import { gray500, gray800, orange500 } from '../../core/Colors';
import { Avatar, AvatarProps, AvatarSize } from '.././Avatar';
Expand Down Expand Up @@ -92,6 +93,7 @@ export const Reply = Object.assign(
}, [avatar, avatarSize, name]);

const preventPropagation = useCallback((event: React.MouseEvent<Element, MouseEvent>) => {
event.preventDefault();
event.stopPropagation();
}, []);

Expand Down

1 comment on commit 16ec27a

@vercel
Copy link

@vercel vercel bot commented on 16ec27a Jun 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.