Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawer 안에서 이벤트 전파 막히는 것 수정했다 #37

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/co-design-core/src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,8 @@ export const CoDrawer = ({
}}
>
{(transitionStyles) => (
<View
className={cx(classes.root, { [classes.noOverlay]: noOverlay }, className)}
role="dialog"
aria-modal
onMouseDown={() => !noCloseOnClickOutside && onClose()}
{...props}
>
<View className={cx(classes.root, { [classes.noOverlay]: noOverlay }, className)} role="dialog" aria-modal {...props}>
<Paper
onMouseDown={(event) => event.stopPropagation()}
className={cx(classes.drawer, className)}
ref={focusTrapRef}
style={{ ...transitionStyles.drawer, zIndex: (zIndex in theme.zIndex ? theme.zIndex[zIndex] : zIndex) + 2 }}
Expand Down Expand Up @@ -186,6 +179,7 @@ export const CoDrawer = ({
opacity={_overlayOpacity}
zIndex={zIndex}
color={overlayColor || (theme.colorScheme === 'dark' ? theme.palettes.gray[9] : theme.colors.black)}
onMouseDown={() => !noCloseOnClickOutside && onClose()}
/>
</div>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Center } from '../../Center';
import { Popover } from '../Popover';
import { useToggle } from '@co-design/hooks';
import { Menu } from '../../Menu';
import { Drawer } from '../../Drawer';
import { Button } from '../../Button';

export default {
title: '@co-design/core/Popover',
Expand Down Expand Up @@ -151,3 +153,26 @@ export const OpenByChildrenWithFlag = {
);
},
};

export const InDrawer = {
render: (props) => {
const [opened, toggleOpened] = useToggle();

return (
<div>
<Button onClick={toggleOpened}>Open</Button>
<Drawer
zIndex={2998}
opened={opened}
onClose={() => {
toggleOpened(false);
}}
>
<Popover zIndex={3001} placement="bottom" content={<Content />} {...props}>
<button>Popover</button>
</Popover>
</Drawer>
</div>
);
},
};