mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-16 13:40:24 +02:00
handle non-list items contextmenu in controls
This commit is contained in:
@@ -232,10 +232,18 @@ export const useDefaultItemListControls = (args?: UseDefaultItemListControlsArgs
|
||||
},
|
||||
|
||||
onMore: ({ event, internalState, item, itemType }: DefaultItemControlProps) => {
|
||||
if (!item || !internalState || !event) {
|
||||
if (!item || !event) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If no internalState, call ContextMenuController directly
|
||||
if (!internalState) {
|
||||
return ContextMenuController.call({
|
||||
cmd: { items: [item] as any[], type: itemType as any },
|
||||
event,
|
||||
});
|
||||
}
|
||||
|
||||
const rowId = internalState.extractRowId(item);
|
||||
|
||||
if (!rowId) return;
|
||||
|
||||
Reference in New Issue
Block a user