File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
lowcoder-design/src/components
lowcoder/src/components/PermissionDialog Expand file tree Collapse file tree 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 }>`
7171 }
7272` ;
7373
74- export type CustomSelectProps = {
74+ export interface CustomSelectProps extends AntdSelectProps {
7575 children ?: JSX . Element | React . ReactNode ;
76- innerRef ?: React . Ref < HTMLDivElement > | undefined ;
7776 border ?: boolean ;
7877} ;
7978
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+ ) => {
8188 const {
8289 children,
83- innerRef,
8490 className,
8591 border,
8692 popupClassName = "custom-ant-select-dropdown" ,
8793 ...restProps
8894 } = props ;
8995 return (
90- < SelectWrapper className = { className } ref = { innerRef } border = { border } >
96+ < SelectWrapper className = { className } ref = { ref } border = { border } >
9197 < AntdSelect
9298 popupClassName = { popupClassName }
9399 popupMatchSelectWidth = { false }
@@ -96,9 +102,10 @@ function CustomSelect(props: CustomSelectProps & AntdSelectProps) {
96102 >
97103 { children }
98104 </ AntdSelect >
105+ < div > </ div >
99106 </ SelectWrapper >
100107 ) ;
101- }
108+ } ) as CustomSelectInterface ;
102109
103110CustomSelect . Option = AntdSelect . Option ;
104111export { CustomSelect } ;
Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ const PermissionSelector = (props: {
328328 < PermissionSelectWrapper >
329329 < AddPermissionsSelect
330330 open
331- innerRef = { selectRef }
331+ ref = { selectRef }
332332 placeholder = { trans ( "home.addPermissionPlaceholder" ) }
333333 mode = "multiple"
334334 getPopupContainer = { ( ) => document . getElementById ( "add-app-user-permission-dropdown" ) ! }
You can’t perform that action at this time.
0 commit comments