Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { getAllowedFormats } from './utils';
import { Content, valueToHTMLString } from './content';
import { withDeprecations } from './with-deprecations';
import BlockContext from '../block-context';
import { PrivateBlockContext } from '../block-list/private-block-context';

export const keyboardShortcutContext = createContext();
keyboardShortcutContext.displayName = 'keyboardShortcutContext';
Expand Down Expand Up @@ -124,9 +125,10 @@ export function RichTextWrapper(
const instanceId = useInstanceId( RichTextWrapper );
const anchorRef = useRef();
const context = useBlockEditContext();
const { clientId, isSelected: isBlockSelected, name: blockName } = context;
const { clientId, isSelected: isBlockSelected } = context;
const blockBindings = context[ blockBindingsKey ];
const blockContext = useContext( BlockContext );
const { bindableAttributes } = useContext( PrivateBlockContext );
const registry = useRegistry();
const selector = ( select ) => {
// Avoid subscribing to the block editor store if the block is not
Expand Down Expand Up @@ -171,15 +173,7 @@ export function RichTextWrapper(

const { disableBoundBlock, bindingsPlaceholder, bindingsLabel } = useSelect(
( select ) => {
const { __experimentalBlockBindingsSupportedAttributes } =
select( blockEditorStore ).getSettings();

if (
! blockBindings?.[ identifier ] ||
! (
blockName in __experimentalBlockBindingsSupportedAttributes
)
) {
if ( ! blockBindings?.[ identifier ] || ! bindableAttributes ) {
return {};
}

Expand Down Expand Up @@ -252,7 +246,7 @@ export function RichTextWrapper(
[
blockBindings,
identifier,
blockName,
bindableAttributes,
adjustedValue,
clientId,
blockContext,
Expand Down
Loading