Skip to content

Commit

Permalink
Fallback for dropcap when __experimentalFeatures is not present (#25979)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored Oct 9, 2020
1 parent 517168a commit 2709751
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/block-editor/src/components/use-editor-feature/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ export default function useEditorFeature( featurePath ) {
// such as core/heading or core/post-title.
const globalPath = `__experimentalFeatures.global.${ featurePath }`;
const blockPath = `__experimentalFeatures.${ blockName }.${ featurePath }`;
return get( settings, blockPath ) ?? get( settings, globalPath );
const experimentalFeature =
get( settings, blockPath ) ?? get( settings, globalPath );
if ( experimentalFeature !== undefined ) {
return experimentalFeature;
}

// 3 - Fall back for typography.dropCap:
// This is only necessary to support typography.dropCap.
// when __experimentalFeatures are not present (core without plugin).
// To remove when __experimentalFeatures are ported to core.
return featurePath === 'typography.dropCap' ? true : undefined;
},
[ blockName, featurePath ]
);
Expand Down

0 comments on commit 2709751

Please sign in to comment.