Skip to content

Commit

Permalink
Blocks: Fix tab navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed May 2, 2017
1 parent c507737 commit 691faec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions blocks/library/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ registerBlock( 'core/quote', {

edit( { attributes, setAttributes, focus, setFocus } ) {
const { value, citation, style = 1 } = attributes;
const focusedEditable = focus ? focus.editable || 'value' : null;

return (
<blockquote className={ `blocks-quote blocks-quote-style-${ style }` }>
Expand All @@ -52,7 +53,7 @@ registerBlock( 'core/quote', {
value: nextValue
} )
}
focus={ focus && focus.editable === 'value' ? focus : null }
focus={ focusedEditable === 'value' ? focus : null }
onFocus={ () => setFocus( { editable: 'value' } ) }
showAlignments
/>
Expand All @@ -65,7 +66,7 @@ registerBlock( 'core/quote', {
citation: nextCitation
} )
}
focus={ focus && focus.editable === 'citation' ? focus : null }
focus={ focusedEditable === 'citation' ? focus : null }
onFocus={ () => setFocus( { editable: 'citation' } ) }
/>
</footer>
Expand Down
2 changes: 2 additions & 0 deletions editor/modes/visual-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ class VisualEditorBlock extends wp.element.Component {
<div
ref={ this.bindBlockNode }
onClick={ onSelect }
onFocus={ onSelect }
onBlur={ this.maybeDeselect }
onKeyDown={ onStartTyping }
onMouseEnter={ onHover }
onMouseMove={ this.maybeHover }
onMouseLeave={ onMouseLeave }
className={ className }
data-type={ block.blockType }
tabIndex="0"
{ ...wrapperProps }
>
{ ( ( isSelected && ! isTyping ) || isHovered ) && <BlockMover uid={ block.uid } /> }
Expand Down

0 comments on commit 691faec

Please sign in to comment.