Skip to content

Commit 775543c

Browse files
committed
Fix lightbox ui appearing with interactivity experiment disabled
1 parent 6a16313 commit 775543c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lib/experimental/editor-settings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ function gutenberg_enable_experiments() {
9292
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-pattern-enhancements', $gutenberg_experiments ) ) {
9393
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnablePatternEnhancements = true', 'before' );
9494
}
95+
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-interactivity-api-core-blocks', $gutenberg_experiments ) ) {
96+
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalInteractivityAPI = true', 'before' );
97+
}
9598

9699
}
97100

packages/block-editor/src/hooks/behaviors.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export const withBehaviors = createHigherOrderComponent( ( BlockEdit ) => {
3838
const settings =
3939
select( blockEditorStore ).getSettings()?.__experimentalFeatures
4040
?.blocks?.[ props.name ]?.behaviors;
41-
4241
if (
4342
! settings ||
4443
// If every behavior is disabled, do not show the behaviors inspector control.
@@ -102,8 +101,10 @@ export const withBehaviors = createHigherOrderComponent( ( BlockEdit ) => {
102101
};
103102
}, 'withBehaviors' );
104103

105-
addFilter(
106-
'editor.BlockEdit',
107-
'core/behaviors/with-inspector-control',
108-
withBehaviors
109-
);
104+
if ( window?.__experimentalInteractivityAPI ) {
105+
addFilter(
106+
'editor.BlockEdit',
107+
'core/behaviors/with-inspector-control',
108+
withBehaviors
109+
);
110+
}

0 commit comments

Comments
 (0)