File tree 2 files changed +14
-7
lines changed
lowcoder/src/components/PermissionDialog
lowcoder-design/src/components
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -71,23 +71,29 @@ const SelectWrapper = styled.div<{ border?: boolean }>`
71
71
}
72
72
` ;
73
73
74
- export type CustomSelectProps = {
74
+ export interface CustomSelectProps extends AntdSelectProps {
75
75
children ?: JSX . Element | React . ReactNode ;
76
- innerRef ?: React . Ref < HTMLDivElement > | undefined ;
77
76
border ?: boolean ;
78
77
} ;
79
78
80
- function CustomSelect ( props : CustomSelectProps & AntdSelectProps ) {
79
+ interface CustomSelectInterface extends React . ForwardRefExoticComponent <
80
+ CustomSelectProps & React . RefAttributes < HTMLDivElement >
81
+ > {
82
+ Option : any ;
83
+ }
84
+ const CustomSelect = React . forwardRef < HTMLDivElement , CustomSelectProps > ( (
85
+ props ,
86
+ ref ,
87
+ ) => {
81
88
const {
82
89
children,
83
- innerRef,
84
90
className,
85
91
border,
86
92
popupClassName = "custom-ant-select-dropdown" ,
87
93
...restProps
88
94
} = props ;
89
95
return (
90
- < SelectWrapper className = { className } ref = { innerRef } border = { border } >
96
+ < SelectWrapper className = { className } ref = { ref } border = { border } >
91
97
< AntdSelect
92
98
popupClassName = { popupClassName }
93
99
popupMatchSelectWidth = { false }
@@ -96,9 +102,10 @@ function CustomSelect(props: CustomSelectProps & AntdSelectProps) {
96
102
>
97
103
{ children }
98
104
</ AntdSelect >
105
+ < div > </ div >
99
106
</ SelectWrapper >
100
107
) ;
101
- }
108
+ } ) as CustomSelectInterface ;
102
109
103
110
CustomSelect . Option = AntdSelect . Option ;
104
111
export { CustomSelect } ;
Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ const PermissionSelector = (props: {
328
328
< PermissionSelectWrapper >
329
329
< AddPermissionsSelect
330
330
open
331
- innerRef = { selectRef }
331
+ ref = { selectRef }
332
332
placeholder = { trans ( "home.addPermissionPlaceholder" ) }
333
333
mode = "multiple"
334
334
getPopupContainer = { ( ) => document . getElementById ( "add-app-user-permission-dropdown" ) ! }
You can’t perform that action at this time.
0 commit comments