Make WordPress Core

Opened 15 months ago

Last modified 5 weeks ago

#45903 new defect (bug)

Twenty Nineteen: Some menu clicks trigger console errors

Reported by: kjellr Owned by:
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.0
Component: Bundled Theme Keywords: has-screenshots has-patch needs-testing
Focuses: javascript Cc:


There are two scenarios where the Twenty Nineteen menu javascript triggers console errors:

First, on desktop screens, clicking the main navigation arrows produce the following error:

TypeError: event.target.matches is not a function[Learn More] 4 touch-keyboard-navigation.js:285:9
	toggleSubmenuDisplay/< ../wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js:285:9


Originally reported by @joyously in: https://github.com/WordPress/twentynineteen/issues/596

Second, on touch-enabled screens, tapping menu items that have empty (#) href attributes result in the following console errors:

TypeError: event.target.nextSibling is null[Learn More] touch-keyboard-navigation.js:223:5 
	toggleSubmenuDisplay/<	../wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js:223:5
	sendTouchEvent	resource://devtools/server/actors/emulation/touch-simulator.js:301:5
	handleEvent	resource://devtools/server/actors/emulation/touch-simulator.js:212:7
TypeError: event.target.matches is not a function[Learn More] touch-keyboard-navigation.js:277:9
	toggleSubmenuDisplay/<	http://core.test/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js:277:9

Originally reported in: https://github.com/WordPress/twentynineteen/issues/726

It looks like a possible fix for one of these was explored by @jmau in the following PR, but it has not yet been tested:


Attachments (1)

45903.patch (2.0 KB) - added by laurelfulford 14 months ago.

Download all attachments as: .zip

Change History (4)

#1 @laurelfulford
14 months ago

  • Keywords has-screenshots added
  • Milestone changed from Awaiting Review to Future Release

Thanks for moving this over, @kjellr! I can recreate both of these issues.

#2 @laurelfulford
14 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

45903.patch copies over the changes from @jmlapam's GitHub PR.

#3 @ianbelanger
5 weeks ago

  • Milestone changed from Future Release to 5.5
  • Version changed from 5.0.2 to 5.0
Note: See TracTickets for help on using tickets.