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

Navigation Link: Handle focus when removing the block #58820

Closed
scruffian opened this issue Feb 8, 2024 · 7 comments · Fixed by #59466 or #59925
Closed

Navigation Link: Handle focus when removing the block #58820

scruffian opened this issue Feb 8, 2024 · 7 comments · Fixed by #59466 or #59925
Labels
[Block] Navigation Link Affects the Navigation Link Block Needs Accessibility Feedback Need input from accessibility [Type] Bug An existing feature does not function as intended

Comments

@scruffian
Copy link
Contributor

What problem does this address?

In #57756 we added an onClose event to the LinkUI, which removes the block when the popover closes if the URL is empty. We need to work out how best to handle focus in this scenario.

What is your proposed solution?

We could return focus to the block, or to the inserter.

@scruffian scruffian added [Type] Bug An existing feature does not function as intended [Block] Navigation Link Affects the Navigation Link Block labels Feb 8, 2024
@scruffian scruffian moved this to 📥 Todo in WordPress 6.5 Editor Tasks Feb 8, 2024
@getdave getdave added the Needs Accessibility Feedback Need input from accessibility label Feb 8, 2024
@getdave
Copy link
Contributor

getdave commented Feb 13, 2024

Focus should return to the inserter + icon.

@getdave
Copy link
Contributor

getdave commented Feb 28, 2024

@scruffian Are you still seeking to address this for WP 6.5?

@getdave
Copy link
Contributor

getdave commented Feb 28, 2024

We could return focus to the block, or to the inserter.

Focus should return to wherever you were previously. In this scenario:

  • Add block using the block inserter plus button
  • Auto-adds link block
  • Link UI appears
  • Close the Link UI without actively applying focus elsewhere (note any solution we implement should not steal focus)
  • Focus should return to the block inserter plus button

However, in order for this to be addressed, I think the various scenarios that could occur need to be outlined more clearly.

@scruffian
Copy link
Contributor Author

The PR that closed this was reverted so this should still be open

@scruffian scruffian reopened this Mar 7, 2024
@scruffian scruffian moved this from ✅ Done to 📥 Todo in WordPress 6.5 Editor Tasks Mar 7, 2024
@youknowriad
Copy link
Contributor

How critical is this for 6.5?

@scruffian
Copy link
Contributor Author

I don't think its critical. Several of us have looked at it and didn't find a solution so maybe we should punt it?

@youknowriad
Copy link
Contributor

Removed from the 6.5 broad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Link Affects the Navigation Link Block Needs Accessibility Feedback Need input from accessibility [Type] Bug An existing feature does not function as intended
Projects
3 participants