diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index deafde69b35c37..de70ba4c05a168 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -74,7 +74,6 @@ function removeNativeProps( props ) { fontStyle, minWidth, maxWidth, - setRef, disableSuggestions, disableAutocorrection, ...restProps diff --git a/packages/block-editor/src/components/rich-text/index.native.js b/packages/block-editor/src/components/rich-text/index.native.js index acadfb24a72217..041496b21e8081 100644 --- a/packages/block-editor/src/components/rich-text/index.native.js +++ b/packages/block-editor/src/components/rich-text/index.native.js @@ -94,14 +94,13 @@ export function RichTextWrapper( minWidth, maxWidth, onBlur, - setRef, disableSuggestions, disableAutocorrection, containerWidth, onEnter: onCustomEnter, ...props }, - forwardedRef + providedRef ) { const instanceId = useInstanceId( RichTextWrapper ); @@ -528,13 +527,13 @@ export function RichTextWrapper( [ onReplace, __unstableMarkAutomaticChange ] ); - const mergedRef = useMergeRefs( [ forwardedRef, fallbackRef ] ); + const mergedRef = useMergeRefs( [ providedRef, fallbackRef ] ); return ( ( + +) ); /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md diff --git a/packages/block-editor/src/components/rich-text/native/index.native.js b/packages/block-editor/src/components/rich-text/native/index.native.js index 7a775cad346488..8b4c871bda7bbf 100644 --- a/packages/block-editor/src/components/rich-text/native/index.native.js +++ b/packages/block-editor/src/components/rich-text/native/index.native.js @@ -1222,8 +1222,8 @@ export class RichText extends Component { ref={ ( ref ) => { this._editor = ref; - if ( this.props.setRef ) { - this.props.setRef( ref ); + if ( this.props.nativeEditorRef ) { + this.props.nativeEditorRef( ref ); } } } style={ { diff --git a/packages/block-library/src/button/edit.native.js b/packages/block-library/src/button/edit.native.js index 214be33c7df2ed..e975710f821e1e 100644 --- a/packages/block-library/src/button/edit.native.js +++ b/packages/block-library/src/button/edit.native.js @@ -494,7 +494,7 @@ function ButtonEdit( props ) { ) } { const { backgroundColor } = attributes; @@ -60,15 +64,13 @@ const getBorderColor = ( props ) => { function PullQuoteEdit( props ) { const { attributes, setAttributes, isSelected, insertBlocksAfter } = props; - const { textAlign, citation, value } = attributes; + const { textAlign, value } = attributes; const blockProps = useBlockProps( { backgroundColor: getBackgroundColor( props ), borderColor: getBorderColor( props ), } ); - const shouldShowCitation = ! RichText.isEmpty( citation ) || isSelected; - return ( <> @@ -96,29 +98,30 @@ function PullQuoteEdit( props ) { } textAlign={ textAlign ?? 'center' } /> - { shouldShowCitation && ( - - setAttributes( { - citation: nextCitation, - } ) - } - __unstableMobileNoFocusOnMount - textAlign={ textAlign ?? 'center' } - __unstableOnSplitAtEnd={ () => - insertBlocksAfter( - createBlock( getDefaultBlockName() ) - ) - } - /> - ) } + + insertBlocksAfter( + createBlock( getDefaultBlockName() ) + ) + } + /> diff --git a/packages/block-library/src/pullquote/test/edit.native.js b/packages/block-library/src/pullquote/test/edit.native.js index c53ad24a33f028..844fffbe5fe561 100644 --- a/packages/block-library/src/pullquote/test/edit.native.js +++ b/packages/block-library/src/pullquote/test/edit.native.js @@ -10,7 +10,6 @@ import { getEditorHtml, fireEvent, within, - waitFor, typeInRichText, } from 'test/helpers'; @@ -26,10 +25,6 @@ describe( 'Pullquote', () => { // Arrange const screen = await initializeEditor(); await addBlock( screen, 'Pullquote' ); - // Await inner blocks to be rendered - const citationBlock = await waitFor( () => - screen.getByPlaceholderText( 'Add citation' ) - ); // Act const pullquoteBlock = getBlock( screen, 'Pullquote' ); @@ -43,7 +38,9 @@ describe( 'Pullquote', () => { keyCode: ENTER, } ); typeInRichText( pullquoteTextInput, 'Again' ); - + fireEvent.press( screen.getByLabelText( 'Add citation' ) ); + const citationBlock = + await screen.findByPlaceholderText( 'Add citation' ); const citationTextInput = within( citationBlock ).getByPlaceholderText( 'Add citation' ); typeInRichText( citationTextInput, 'A person' ); diff --git a/packages/block-library/src/quote/edit.js b/packages/block-library/src/quote/edit.js index 401bd92fd1cbf5..dfa9f33033d8a6 100644 --- a/packages/block-library/src/quote/edit.js +++ b/packages/block-library/src/quote/edit.js @@ -105,7 +105,7 @@ export default function QuoteEdit( { { }, } ); - // Await inner blocks to be rendered - const citationBlock = await waitFor( () => - screen.getByPlaceholderText( 'Add citation' ) - ); // Act fireEvent.press( quoteBlock ); - // screen.debug(); let quoteTextInput = within( quoteBlock ).getByPlaceholderText( 'Start writing…' ); typeInRichText( quoteTextInput, 'A great statement.' ); @@ -61,6 +55,10 @@ describe( 'Quote', () => { 'Start writing…' )[ 1 ]; typeInRichText( quoteTextInput, 'Again.' ); + fireEvent.press( screen.getByLabelText( 'Navigate Up' ) ); + fireEvent.press( screen.getByLabelText( 'Add citation' ) ); + const citationBlock = + await screen.findByPlaceholderText( 'Add citation' ); const citationTextInput = within( citationBlock ).getByPlaceholderText( 'Add citation' ); typeInRichText( citationTextInput, 'A person' ); diff --git a/packages/editor/src/components/post-title/index.native.js b/packages/editor/src/components/post-title/index.native.js index d82206303314a3..810c27ead408a3 100644 --- a/packages/editor/src/components/post-title/index.native.js +++ b/packages/editor/src/components/post-title/index.native.js @@ -164,7 +164,7 @@ class PostTitle extends Component { accessibilityHint={ __( 'Updates the title.' ) } >