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: pseudo states do not apply to parent items that are buttons #43487

Open
mikachan opened this issue Aug 22, 2022 · 0 comments
Open
Labels
[Block] Navigation Link Affects the Navigation Link Block [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended

Comments

@mikachan
Copy link
Member

Description

In the navigation block, with the 'Open on click' option enabled, parent menu items that have sub-menus cannot have their pseudo states styled via theme.json.

There is a specific example described here, using Twenty Twenty-Three.

Parent items that have sub menus are not underlined on hover anymore -they are buttons. As a user I would expect the menu to look the same when I enable this option.

When the 'Open on click' option is disabled, the parent items are links, and can successfully have their pseudo states controlled via theme.json.

Step-by-step reproduction instructions

  1. Activate a theme that configures pseudo states for the navigation block via theme.json (Twenty Twenty-Three is an example)
  2. In the Side Editor, enable the 'Open on click' option for the navigation block. This should turn the parent menu items into buttons instead of links.

image

  1. Add the following to the theme.json:
"styles": {
		"blocks": {
			"core/navigation": {
				"elements": {
					"button": {
						":hover": {
							"typography": {
								"textDecoration": "underline"
							}
						},
						":focus": {
							"typography": {
								"textDecoration": "underline"
							}
						},
						"typography": {
							"textDecoration": "none"
						}
					},
			},
...
  1. Notice that the button pseudo state styles are not applied to the parent menu items.

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.0.1, GB trunk, Twenty Twenty-Three

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@mikachan mikachan added [Block] Navigation Affects the Navigation Block [Block] Navigation Link Affects the Navigation Link Block labels Aug 22, 2022
@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Sep 1, 2023
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 [Block] Navigation Affects the Navigation Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants