Open calvinrodrigues500 opened 1 day ago
Warning: Type of PR label mismatch
To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.
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: calvinrodrigues500 <calvinrodrigues@git.wordpress.org>
Co-authored-by: bradhogan <bradley2083@git.wordpress.org>
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.
:wave: Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @calvinrodrigues500! In case you missed it, we'd love to have you join us in our Slack community.
If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.
What?
Category List Block: Set current category as the default selected item in dropdown Fixes #66613
When the Category List block is added to a category archive template in Gutenberg, the dropdown displays "Select Category" by default on archive pages, even though a specific category is being viewed. Ideally, the dropdown should show the active category as the selected item.
Why?
This improvement enhances user experience by reducing confusion and making navigation clearer. Displaying the active category reinforces context for users on archive pages and aligns with expected dropdown behavior.
How?
This PR updates the Category List block to detect the current category when used on a category archive template. By setting the active category as the default selected item in the dropdown, it aligns the block’s behavior with user expectations on archive pages. This change ensures that when users view a category archive, the dropdown automatically reflects the category they are currently browsing,
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Screencast from 01-11-24 12:29:32 PM IST.webm