Skip to content

Commit

Permalink
Update writing flow to disable navigation mode for new posts so that …
Browse files Browse the repository at this point in the history
…the first tab from the title starts editing the content
  • Loading branch information
brentswisher committed Oct 14, 2019
1 parent 090b89e commit 5cdc3d2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/block-editor/src/components/writing-flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,11 @@ class WritingFlow extends Component {
}

render() {
const { children } = this.props;
const { children, isCleanNewPost } = this.props;

if ( isCleanNewPost ) {
this.disableNavigationMode();
}

// Disable reason: Wrapper itself is non-interactive, but must capture
// bubbling events from children to determine focus transition intents.
Expand Down Expand Up @@ -415,6 +419,8 @@ class WritingFlow extends Component {

export default compose( [
withSelect( ( select ) => {
const { isCleanNewPost } = select( 'core/editor' );

const {
getSelectedBlockClientId,
getMultiSelectedBlocksStartClientId,
Expand All @@ -431,8 +437,8 @@ export default compose( [
const selectedBlockClientId = getSelectedBlockClientId();
const selectionStartClientId = getMultiSelectedBlocksStartClientId();
const selectionEndClientId = getMultiSelectedBlocksEndClientId();

return {
isCleanNewPost: isCleanNewPost(),
selectedBlockClientId,
selectionStartClientId,
selectionBeforeEndClientId: getPreviousBlockClientId( selectionEndClientId || selectedBlockClientId ),
Expand Down

0 comments on commit 5cdc3d2

Please sign in to comment.