Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing Flow: Cannot type after clicking below writing prompt in new post #17776

Closed
aduth opened this issue Oct 4, 2019 · 2 comments · Fixed by #17798
Closed

Writing Flow: Cannot type after clicking below writing prompt in new post #17776

aduth opened this issue Oct 4, 2019 · 2 comments · Fixed by #17798
Assignees
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@aduth
Copy link
Member

aduth commented Oct 4, 2019

Describe the bug

Previously, when starting a new post, you could click anywhere in the blank space and start typing immediately. Currently, this does not work as expected.

  • When clicking on the "click redirect" element, a new paragraph is added, but the caret is not placed immediately within it. Another click is necessary to begin typing.
  • The "click redirect" element is assigned a maximum height (50vh), so clicking toward at the bottom of the viewport will not create or focus the last block.

For context, this behavior was originally implemented to mimic the behavior of other editors and text fields (e.g. the empty space below the first line of text in the comment field textarea on this page).

There's even an end-to-end test which is falsely passing which is expected to enforce this behavior of immediately typing after clicking in the space below the writing prompt:

await clickBelow( await page.$( '.block-editor-default-block-appender' ) );
expect( await page.$( '[data-type="core/paragraph"]' ) ).not.toBeNull();
await page.keyboard.type( 'Paragraph block' );

To reproduce

Steps to reproduce the behavior:

  1. Navigate to Posts > Add New
  2. Click below the writing prompt
  3. Start typing
  4. Note that while the paragraph was created and is focused, your typed characters are not reflected because the caret was not placed within the paragraph

Expected behavior

A new paragraph is created, and typing results in characters added to the paragraph.

Desktop:

  • OS: macOS Mojave 10.14.6 (18G103)
  • Browser: Google Chrome Version 77.0.3865.90 (Official Build) (64-bit)

Additional context:

Ideas for suspected causes:

Presumably, the behavior worked based on the following steps:

@aduth aduth added [Type] Bug An existing feature does not function as intended [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Regression Related to a regression in the latest release labels Oct 4, 2019
@aduth
Copy link
Member Author

aduth commented Oct 4, 2019

@youknowriad I think this was introduced in #16500. Specifically, the logic which would normally result in the newly-added paragraph from focusing itself bails because the "breadcrumb" is considered the focused element at this condition:

// Focus is captured by the wrapper node, so while focus transition
// should only consider tabbables within editable display, since it
// may be the wrapper itself or a side control which triggered the
// focus event, don't unnecessary transition to an inner tabbable.
if ( wrapper.current.contains( document.activeElement ) ) {
return;
}

@youknowriad
Copy link
Contributor

the edit mode is supposed to be triggered when you click the canvas. I think the issue here is that it's not when we click the redirect element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants