From 04532b49d351076ac0c84a599aee16c10f106f3c Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 16 Feb 2018 14:10:43 +0100 Subject: [PATCH] Quote Block: Fixing focus transfer between citation and content --- blocks/library/pullquote/editor.scss | 4 ++++ blocks/library/quote/editor.scss | 4 ++++ blocks/library/quote/index.js | 4 +++- blocks/rich-text/index.js | 4 +++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/blocks/library/pullquote/editor.scss b/blocks/library/pullquote/editor.scss index 8ebe0a7286aee..5494e74d2a2cc 100644 --- a/blocks/library/pullquote/editor.scss +++ b/blocks/library/pullquote/editor.scss @@ -11,6 +11,10 @@ } .wp-block-pullquote { + cite { + display: block; + } + cite .blocks-rich-text__tinymce[data-is-empty="true"]:before { font-size: 14px; font-family: $default-font; diff --git a/blocks/library/quote/editor.scss b/blocks/library/quote/editor.scss index de83bc5f7f0fe..e36feff5126ac 100644 --- a/blocks/library/quote/editor.scss +++ b/blocks/library/quote/editor.scss @@ -1,5 +1,9 @@ .wp-block-quote { margin: 0; + + cite { + display: block; + } } .wp-block-quote:not(.is-large) { diff --git a/blocks/library/quote/index.js b/blocks/library/quote/index.js index de4119dd88767..7e069be11fbff 100644 --- a/blocks/library/quote/index.js +++ b/blocks/library/quote/index.js @@ -158,7 +158,9 @@ export const settings = { } )( ( { attributes, setAttributes, isSelected, mergeBlocks, onReplace, className, editable, setState } ) => { const { align, value, citation, style } = attributes; const containerClassname = classnames( className, style === 2 ? 'is-large' : '' ); - const onSetActiveEditable = ( newEditable ) => () => setState( { editable: newEditable } ); + const onSetActiveEditable = ( newEditable ) => () => { + setState( { editable: newEditable } ); + }; return [ isSelected && ( diff --git a/blocks/rich-text/index.js b/blocks/rich-text/index.js index 8a94d86794e8b..6fabfd30220c6 100644 --- a/blocks/rich-text/index.js +++ b/blocks/rich-text/index.js @@ -740,7 +740,9 @@ export class RichText extends Component { !! this.editor && this.props.tagName === prevProps.tagName && this.props.value !== prevProps.value && - this.props.value !== this.savedContent + this.props.value !== this.savedContent && + ! isEqual( this.props.value, prevProps.value ) && + ! isEqual( this.props.value, this.savedContent ) ) { this.updateContent(); }