-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Gallery Block: Add toolbar button to add a caption #47325
Conversation
Size Change: +167 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in 10cf94d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3973822524
|
await expect( caption ).toBeVisible(); | ||
await caption.click(); | ||
await expect( caption ).toBeFocused(); |
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.
Pressing the caption button brings focus to the caption textbox automatically.
Therefore, I believe This is more reasonable than tobeVisible
.
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.
Makes sense 👍
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.
@t-hamano Thanks. This works well for me.
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.
LGTM. Good stuff.
@alexstine |
Closes: #45857
Related to: #44965, #45112
What?
This PR adds a toggle toolbar item on the gallery block toolbar to add/remove a caption.
Why?
To unify the UI with the changes made in #44965. At the same time, accessibility regarding focus on keyboard operations will be improved.
How?
The implementation is based on what is done in the image block.
Testing Instructions
I have confirmed that the focus is lost from the gallery block at this time. However, since this issue also occurs in the latest trunk and I reported in Gallery Block: Focus is lost after inserting images #47326.
68a952592a03d21d0f55f47b3c12f746.mp4
Testing Instructions for Keyboard
Use the following markup for testing:
Test Data
Use the up and down keys to make sure that the focus is correctly moved on the block and RichText area.
d2bf032318d04ce35d1e61f98aa86b16.mp4