File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
lowcoder-design/src/components
lowcoder/src/comps/comps/tableComp/column/columnTypeComps Expand file tree Collapse file tree 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>) {
163163 const dropdownElems = document . querySelectorAll < HTMLElement > ( "div.ant-dropdown ul.ant-dropdown-menu" ) ;
164164 for ( let index = 0 ; index < dropdownElems . length ; index ++ ) {
165165 const element = dropdownElems [ index ] ;
166- console . log ( element ) ;
167166 element . style . maxHeight = "300px" ;
168167 element . style . overflowY = "scroll" ;
169168 element . style . minWidth = "150px" ;
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export const ColumnDropdownComp = (function () {
3737 key : option . label + " - " + index ,
3838 disabled : option . disabled ,
3939 icon : hasOptionIcon && < span > { option . prefixIcon } </ span > ,
40- onEvent : option . onEvent ,
40+ index ,
4141 } ) ) ;
4242
4343 const hasPrefixIcon = ( props . prefixIcon as ReactElement ) ?. props . value ;
@@ -48,7 +48,13 @@ export const ColumnDropdownComp = (function () {
4848 < Menu
4949 items = { items }
5050 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 ( ) ;
5258 } }
5359 />
5460 ) ;
@@ -57,7 +63,6 @@ export const ColumnDropdownComp = (function () {
5763 < Dropdown
5864 trigger = { [ "click" ] }
5965 placement = "bottomRight"
60- menu = { { items} }
6166 dropdownRender = { ( ) => menu }
6267 >
6368 < Button100
You can’t perform that action at this time.
0 commit comments