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

Avoid focus attempt on a non-existent post title in code editor #29922

Open
wants to merge 1 commit into
base: trunk
from

Conversation

@jeremyfelt
Copy link
Member

@jeremyfelt jeremyfelt commented Mar 17, 2021

Description

If a post type has no title support, then ref.current is undefined and there is no ownerDocument to read nor title to focus. See #29921

How has this been tested?

  1. Register a post type with no title support
  2. Add a new post of that post type
  3. Attempt to switch to code editor view

  1. Register a post type with title support
  2. Add a new post of that post type
  3. Attempt to switch to code editor view

Types of changes

Bug fix, see #29921.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.
If a post type has no title support, then `ref.current` is
`undefined` and there is no `ownerDocument` to read nor title
to focus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant