From 6258aaabb75f97f14b192e69434e8d9940deddea Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 21 Oct 2025 07:34:37 -0500 Subject: [PATCH] Check for RichText bindings from context instead of new subscription --- .../src/components/rich-text/index.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index a06d7ef9ce0985..a1e0f2fa75416e 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -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'; @@ -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 @@ -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 {}; } @@ -252,7 +246,7 @@ export function RichTextWrapper( [ blockBindings, identifier, - blockName, + bindableAttributes, adjustedValue, clientId, blockContext,