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

Fixed nonfatal error tabbing away from preview frame in Site Editor #69079

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

Mayank-Tripathi32
Copy link
Contributor

@Mayank-Tripathi32 Mayank-Tripathi32 commented Feb 6, 2025

What?

Closes #69037
Fixes tab navigation error in Site Editor preview frame

Why?

Tab navigation from preview frame causes console errors after #65204 removed an early return condition. Issue doesn't exist in WP 6.7.1 without Gutenberg.

How?

Restores early return in useTabNav hook:

if (event.defaultPrevented || (!hasMultiSelection() && !getSelectedBlockClientId())) {
    return;
}

This prevents unnecessary processing when no selection exists, fixing the error while maintaining functionality.

Testing Instructions

  • Open Site Editor
  • Tab through UI until preview frame is focused
  • Tab forward/backward from preview frame
  • Verify no console errors appear

Testing Instructions for Keyboard

  • Open Site Editor
  • Use Tab key to navigate through interface elements
  • When preview frame is focused (visible focus outline), press Tab and Shift+Tab
  • Verify seamless navigation without console errors
  • Confirm focus moves correctly to next/previous UI elements

ScreenCast

Test.Focus.mov

@Mayank-Tripathi32 Mayank-Tripathi32 marked this pull request as ready for review February 6, 2025 12:57
Copy link

github-actions bot commented Feb 6, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mayank-Tripathi32 <[email protected]>
Co-authored-by: singhakanshu00 <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: stokesman <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@stokesman stokesman added [Type] Bug An existing feature does not function as intended [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... labels Feb 8, 2025
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... [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nonfatal error tabbing away from preview frame in Site Editor
2 participants