WordPress.org

Make WordPress Core

Opened 9 months ago

Last modified 2 months ago

#45917 new enhancement

Twenty Nineteen: Consider adding a search option in the page header

Reported by: kjellr Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0.2
Component: Bundled Theme Keywords:
Focuses: javascript, multisite Cc:
PR Number:

Description

Originally noted by @dartiss in the Twenty Nineteen GitHub repository:

https://github.com/WordPress/twentynineteen/issues/583

Twenty Nineteen only has one widget area (in the page footer) and does not allow users to place a search field on the top of the page. Many users would likely benefit from that functionality, so it could be considered for a future release.

Change History (2)

#1 @laurelfulford
9 months ago

  • Type changed from defect (bug) to enhancement

#2 @craigtommola
2 months ago

  • Focuses javascript multisite added

Curious if this has been looked into further ... I'd suggest that there's a bug beneath the decision to leave out the search field. I'm working in a child theme of 2019 and added a search field both "long hand" and with get_search_form(). On pages which also have navigation (I'm working in a multisite network - some subsites do not have a menu / nav) the search won't work while within div.site-branding ... it loses focus when I try to insert my cursor.

In the event listeners tab of Chrome dev tools, /wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js?ver=1.1 seems to be the culprit? If I comment out the wp_enqueue_script at /wp-content/themes/twentynineteen/functions.php:226 the search field works consistently.

I'm probably going to end up with a bunch of extraneous wrappers to sort this out, but if there's a more correct solution, it'd be much appreciated.

Note: See TracTickets for help on using tickets.