Skip to content

Commit 06b848a

Browse files
committed
Fix deleting a field from the Structure panel showing an empty panel
1 parent 7f9f7dc commit 06b848a

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

assets/app/components/Panels/Structure/Actions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ const Actions = ( { field, addFieldBefore, addFieldAfter, duplicateField, remove
5757
};
5858

5959
return (
60-
<>
60+
// Prevent selecting the field when selecting an action.
61+
<div onClick={ e => e.stopPropagation() }>
6162
<DropdownMenu className="og-item__actions" icon={ moreVertical } label={ __( 'Select an action', 'meta-box-builder' ) }>
6263
{
6364
( { onClose } ) => (
@@ -109,7 +110,7 @@ const Actions = ( { field, addFieldBefore, addFieldAfter, duplicateField, remove
109110
</Modal>
110111
)
111112
}
112-
</>
113+
</div>
113114
);
114115
};
115116

assets/app/list-functions.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,9 @@ const createList = ( { id = '', fields = [] } ) => {
170170
if ( newActiveFieldId ) {
171171
// Set the new active field
172172
setFieldActive( newActiveFieldId );
173-
setNavPanel( 'field-settings' );
174173
} else if ( isCurrentListGroup ) {
175174
// No fields left in group, set the group as active
176175
setFieldActive( currentState.id );
177-
setNavPanel( 'field-settings' );
178176
} else {
179177
// Root list with no fields, set nav panel to field-group-settings
180178
setNavPanel( 'field-group-settings' );

0 commit comments

Comments
 (0)