Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#56767 closed defect (bug) (invalid)

Navigation Block stops being clickable, if custom Gutenberg Block is present

Reported by: samreciter's profile samreciter Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.0.2
Component: Editor Keywords: needs-patch
Focuses: ui, javascript Cc:

Description

The new Navigation Gutenberg Block stops being clickable on the front end, if a custom Gutenberg Block is present on the same page. Tried with different of working custom Blocks of my own. Seems somehow there must be Javascript in the background that hinders the link execution. No Javascript errors are shown in the console. No custom Javascript is included via the custom blocks - thus the link blocking Javascript must be contained in the WordPress core code.

Change History (5)

#1 in reply to: ↑ description @samreciter
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Replying to samreciter:

The new Navigation Gutenberg Block stops being clickable on the front end, if a custom Gutenberg Block is present on the same page. Tried with different of working custom Blocks of my own. Seems somehow there must be Javascript in the background that hinders the link execution. No Javascript errors are shown in the console. No custom Javascript is included via the custom blocks - thus the link blocking Javascript must be contained in the WordPress core code.

Seems to have something to do with the styling:

@media (min-width: 600px)
.wp-block-navigation__responsive-close {
  pointer-events: none;
}

I'll try to find out more first.

#2 follow-up: @desrosj
3 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

@samreciter was closing this intentional? Reopening to confirm. If you've solved the issue, please share a brief description in case others find this ticket in the future.

#3 @desrosj
3 years ago

  • Component changed from General to Editor

#4 in reply to: ↑ 2 @samreciter
3 years ago

Replying to desrosj:

@samreciter was closing this intentional? Reopening to confirm. If you've solved the issue, please share a brief description in case others find this ticket in the future.

Thanks for the reply.
I closed the issue intentionally, as i solved the issue and haven't had the time to investigate further.

My new theme is using the new full site editor and theme.json
The problem occured with the new theme and older custom Gutenberg blocks.
The problem was solved with changing the custom blocks to the new block registration via block.json

I would assume the problem was created by an improper inclusion of the stylesheets of the older custom blocks into the theme and basic gutenberg stylesheets - resulting in a broken CSS.

Thus CSS rules were executed that shouldn't be active - in this specific case it was the rule:

@media (min-width: 600px)
.wp-block-navigation__responsive-close {
  pointer-events: none;
}

that somehow now was applied to the links in the navigation block and blocking their function.

After updating the old Gutenberg blocks to the new block registraition via block.json everything worked again without any problems.

#5 @desrosj
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from reopened to closed

Great! Thank you for the confirmation!

Note: See TracTickets for help on using tickets.