We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11a9943 commit a241134Copy full SHA for a241134
packages/block-library/src/navigation-submenu/index.js
@@ -21,16 +21,23 @@ export const settings = {
21
if ( context === 'list-view' ) {
22
return page;
23
}
24
-
25
return addSubmenu;
26
},
+ __experimentalLabel( attributes, { context } ) {
27
+ const { label } = attributes;
28
- __experimentalLabel: ( { label } ) => label,
29
+ const customName = attributes?.metadata?.name;
30
- edit,
31
+ // In the list view, use the block's menu label as the label.
32
+ // If the menu label is empty, fall back to the default label.
33
+ if ( context === 'list-view' && ( customName || label ) ) {
34
+ return attributes?.metadata?.name || label;
35
+ }
36
37
+ return label;
38
+ },
39
+ edit,
40
save,
41
transforms,
42
};
43
0 commit comments