@@ -10,7 +10,6 @@ const MDBDropdownMenu: React.FC<DropdownMenuProps> = ({
1010 tag : Tag ,
1111 children,
1212 style,
13- wrapperStyle,
1413 dark,
1514 responsive,
1615 ...props
@@ -105,28 +104,27 @@ const MDBDropdownMenu: React.FC<DropdownMenuProps> = ({
105104 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
106105 //@ts -ignore
107106 return attachELements ? (
108- < div
109- className = 'position-absolute'
110- ref = { setPopperElement }
107+ < Tag
108+ className = { classes }
109+ style = { { position : 'absolute' , zIndex : 1000 , ...styles . popper , ...style } }
110+ { ...props }
111111 { ...attributes . popper }
112- style = { { display : 'block' , zIndex : 1000 , ... styles . popper , ... wrapperStyle } }
112+ ref = { setPopperElement }
113113 tabIndex = { - 1 }
114114 >
115- < Tag className = { classes } style = { { ...style } } { ...props } tabIndex = { - 1 } >
116- { React . Children . map ( children , ( child : any , index ) => {
117- if ( child ?. type === MDBDropdownItem ) {
118- return React . cloneElement ( child , {
119- tabIndex : 0 ,
120- 'data-active' : activeIndex === index && true ,
121- 'data-index' : index ,
122- className : activeIndex === index ? 'active' : '' ,
123- } ) ;
124- } else {
125- return child ;
126- }
127- } ) }
128- </ Tag >
129- </ div >
115+ { React . Children . map ( children , ( child : any , index ) => {
116+ if ( child ?. type === MDBDropdownItem ) {
117+ return React . cloneElement ( child , {
118+ tabIndex : 0 ,
119+ 'data-active' : activeIndex === index && true ,
120+ 'data-index' : index ,
121+ className : activeIndex === index ? 'active' : '' ,
122+ } ) ;
123+ } else {
124+ return child ;
125+ }
126+ } ) }
127+ </ Tag >
130128 ) : (
131129 ''
132130 ) ;
0 commit comments