-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Improve Social Icons setup and appending #64877
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +409 B (+0.02%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Flipping this back to draft status until I'm confident in the keyboard implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if there are improvements to made, this is so much better I think we should move forward with it. There's an odd need to double press the arrow to reach the next item. That's on trunk too though, so shouldn't block here.
templateLock: false, | ||
orientation: attributes.layout?.orientation ?? 'horizontal', | ||
__experimentalAppenderTagName: 'li', | ||
renderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a focus loss when pressing escape from the appender popover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'll take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't seem to replicate this...how do you do it?
How do you track focus? I'm using document.activeElement
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Navigate to the appender
- Press Enter
- Focus is within the popover
- Press Escape
- Focus is...? It should be visible and on the appender again since that's what opened the popover.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh man. I missed the word "appender". My bad. I was looking at the URL popover 🤦
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit which aims to restore focus to the appender once the quick inserter is closed. LMK what you think 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Thank you!
Fixed in #64883 |
@jeryj Looks like you have some feedback and suggestions there. Those would be outside the scope of this PR. AFAIK my PR does not make the keyboard navigability any worse so shall we merge here and iterate in your PR? |
Oh for sure. I was just logging things to note them that they were reviewed and matched on trunk. Not to suggest to fix them here. |
If we can figure out a way to get focus back to the appender when closing the popover, this will be ready to merge. |
I spent quite a while trying this morning. I've got to the stage where I"m considering stripping out the My current suspect is a parent component re-render is causing the element reference to change. |
Flaky tests detected in a1b2a22. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10618610579
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, it works much better with keyboard ❤️ |
Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: jeryj <jeryj@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Fixes #60120
What?
Improves the ability to add new social icons.
This will be nicely complemented by #59303.
Why?
Currently the initial and subsequent states of the Social Icons block(s) can make it very challenging to add new social links. This PR seeks to improve that.
How?
Click + to add
instruction. It was always a stop gap and provided a poor UX.Testing Instructions
Testing Instructions for Keyboard
My main concerns is how the focus move should work. I can use arrow keys to reach the appender but I'm not sure that resolves the problems in #60120.
I'll do some more digging on this as I'm not confident it's good enough yet.
Screenshots or screencast
Before
Screen.Capture.on.2024-08-28.at.16-07-03.mp4
After
Screen.Capture.on.2024-08-28.at.16-05-22.mp4