File tree 2 files changed +8
-4
lines changed
lowcoder/src/comps/comps/tableComp/column/columnTypeComps
lowcoder-design/src/components
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,6 @@ export function Dropdown<T extends OptionsType>(props: DropdownProps<T>) {
163
163
const dropdownElems = document . querySelectorAll < HTMLElement > ( "div.ant-dropdown ul.ant-dropdown-menu" ) ;
164
164
for ( let index = 0 ; index < dropdownElems . length ; index ++ ) {
165
165
const element = dropdownElems [ index ] ;
166
- console . log ( element ) ;
167
166
element . style . maxHeight = "300px" ;
168
167
element . style . overflowY = "scroll" ;
169
168
element . style . minWidth = "150px" ;
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export const ColumnDropdownComp = (function () {
37
37
key : option . label + " - " + index ,
38
38
disabled : option . disabled ,
39
39
icon : hasOptionIcon && < span > { option . prefixIcon } </ span > ,
40
- onEvent : option . onEvent ,
40
+ index ,
41
41
} ) ) ;
42
42
43
43
const hasPrefixIcon = ( props . prefixIcon as ReactElement ) ?. props . value ;
@@ -48,7 +48,13 @@ export const ColumnDropdownComp = (function () {
48
48
< Menu
49
49
items = { items }
50
50
onClick = { ( { key } ) => {
51
- items . find ( ( o ) => o . key === key ) ?. onEvent ?.( "click" )
51
+ const item = items . find ( ( o ) => o . key === key ) ;
52
+ const itemIndex = props . options . findIndex ( option => option . label === item ?. label ) ;
53
+ item && props . options [ itemIndex ] ?. onEvent ( "click" ) ;
54
+ } }
55
+ onMouseDown = { ( e ) => {
56
+ e . stopPropagation ( ) ;
57
+ e . preventDefault ( ) ;
52
58
} }
53
59
/>
54
60
) ;
@@ -57,7 +63,6 @@ export const ColumnDropdownComp = (function () {
57
63
< Dropdown
58
64
trigger = { [ "click" ] }
59
65
placement = "bottomRight"
60
- menu = { { items} }
61
66
dropdownRender = { ( ) => menu }
62
67
>
63
68
< Button100
You can’t perform that action at this time.
0 commit comments