diff --git a/app/client/src/selectors/entitiesSelector.ts b/app/client/src/selectors/entitiesSelector.ts index 34d43cce42..ee6ae4677c 100644 --- a/app/client/src/selectors/entitiesSelector.ts +++ b/app/client/src/selectors/entitiesSelector.ts @@ -489,7 +489,7 @@ export const getExistingPageNames = createSelector( export const getExistingWidgetNames = createSelector( (state: AppState) => state.entities.canvasWidgets, - (widgets) => Object.values(widgets).map((widget) => widget.pageName), + (widgets) => Object.values(widgets).map((widget) => widget.widgetName), ); export const getExistingActionNames = createSelector( @@ -507,7 +507,13 @@ export const getExistingActionNames = createSelector( ); // if the current action being edited is on the same page, filter the actions on the page and return their names. - if (editingAction && editingAction[0].config.pageId === currentPageId) { + // or if the there is no current action being edited (this happens when a widget, or any other entity is being edited), return the actions on the page. + if ( + (editingAction && + editingAction.length > 0 && + editingAction[0].config.pageId === currentPageId) || + (editingAction && editingAction.length < 1) + ) { return actions.map( (actionItem: { config: { name: string; pageId: string } }) => { if (actionItem.config.pageId === currentPageId) {