Skip to content

Commit

Permalink
Quote Block: Fixing focus transfer between citation and content
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 16, 2018
1 parent 2b9bc80 commit 04532b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions blocks/library/pullquote/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions blocks/library/quote/editor.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.wp-block-quote {
margin: 0;

cite {
display: block;
}
}

.wp-block-quote:not(.is-large) {
Expand Down
4 changes: 3 additions & 1 deletion blocks/library/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
Expand Down
4 changes: 3 additions & 1 deletion blocks/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 04532b4

Please sign in to comment.