Skip to content

Commit 4ab9d0d

Browse files
Phil Jenmeta-codesync[bot]
authored andcommitted
Fix SmartActionsDropdown to execute actions immediately on click
Summary: The SmartActionsDropdown context menu was requiring two clicks to execute an action: one click to select it in the dropdown, then another click on the main button to actually run it. This was inconsistent with the old SmartActionsMenu behavior where clicking any action immediately executed it. The fix adds `runSmartAction()` and `bumpSmartAction()` calls to the context menu's onClick handler, so actions execute immediately when selected from the dropdown - matching user expectations for context menus and the behavior of the legacy SmartActionsMenu. Reviewed By: nsblake Differential Revision: D92887268 fbshipit-source-id: db804da9ccfd78b6822319e995ee5386641c14b0
1 parent 0878337 commit 4ab9d0d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

addons/isl/src/smartActions/SmartActionsDropdown.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ export function SmartActionsDropdown({commit}: {commit?: CommitInfo}) {
130130
),
131131
onClick: () => {
132132
setSelectedAction(actionItem);
133+
// Run the action immediately on click instead of requiring a second click
134+
runSmartAction(actionItem.config, context);
135+
bumpSmartAction(actionItem.id);
133136
},
134137
tooltip: actionItem.config.description ? t(actionItem.config.description) : undefined,
135138
})),

0 commit comments

Comments
 (0)