File tree 1 file changed +15
-12
lines changed
client/packages/common/src/ui/components/popover/PaperPopover/PaperClickPopover
1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
import React , { FC , PropsWithChildren } from 'react' ;
2
2
import { ClickPopover , ClickPopoverProps } from '../../ClickPopover' ;
3
3
import Paper , { PaperProps } from '@mui/material/Paper' ;
4
+ import { ClickAwayListener } from '@mui/material' ;
4
5
5
6
export interface PaperClickPopoverProps extends ClickPopoverProps {
6
7
height ?: number ;
@@ -30,18 +31,20 @@ export const PaperClickPopover: FC<
30
31
placement = { placement }
31
32
className = { className }
32
33
Content = {
33
- < Paper
34
- sx = { {
35
- height : height ? `${ height } px` : 'auto' ,
36
- width : width ? `${ width } px` : 'auto' ,
37
- borderRadius : '16px' ,
38
- boxShadow : theme => theme . shadows [ 7 ] ,
39
- ...paperProps ?. sx ,
40
- } }
41
- { ...paperProps }
42
- >
43
- { Content }
44
- </ Paper >
34
+ < ClickAwayListener onClickAway = { hide } >
35
+ < Paper
36
+ sx = { {
37
+ height : height ? `${ height } px` : 'auto' ,
38
+ width : width ? `${ width } px` : 'auto' ,
39
+ borderRadius : '16px' ,
40
+ boxShadow : theme => theme . shadows [ 7 ] ,
41
+ ...paperProps ?. sx ,
42
+ } }
43
+ { ...paperProps }
44
+ >
45
+ { Content }
46
+ </ Paper >
47
+ </ ClickAwayListener >
45
48
}
46
49
>
47
50
{ children }
You can’t perform that action at this time.
0 commit comments