Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions editor/components/writing-flow/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@ class WritingFlow extends Component {
const blockContainer = this.container.querySelector( `[data-block="${ this.props.selectedBlockUID }"]` );
if ( blockContainer && ! blockContainer.contains( document.activeElement ) ) {
const target = this.getInnerTabbable( blockContainer, this.props.initialPosition === -1 );

// Avoid selecting the target if it's:
// - The default block appender (or generally uneditable)
// - Within a nested block
if ( target.readOnly || target.closest( '[data-block]' ) !== blockContainer ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks some behaviors:

  • splitting inside container blocks like "columns".
  • selecting an image and hitting Enter inside container blocks

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I can confirm this, though I wouldn't have expected it, since these behaviors should be finding inputs within the selected block, at which point it should be finding the selected nested's inputs correctly. Will investigate...

return;
}

target.focus();
if ( this.props.initialPosition === -1 ) {
// Special casing RichText components because the two functions at the bottom are not working as expected.
Expand Down