Skip to content
Snippets Groups Projects
Commit 6e94cbcb authored by Chris Hallberg's avatar Chris Hallberg
Browse files

Remove autofocus from searchbox to prevent autocomplete covering in various...

Remove autofocus from searchbox to prevent autocomplete covering in various situations. Added JS to autoselect on the search home screen.
parent f4b731a2
No related merge requests found
......@@ -38,6 +38,7 @@ JS;
<div class="well well-lg clearfix" role="search">
<?=$this->context($this)->renderInContext("search/searchbox.phtml", ['ignoreHiddenFilterMemory' => true])?>
</div>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$("#searchForm_lookfor").focus();', 'SET'); ?>
</div>
<? if (isset($facetList) && is_array($facetList)): ?>
......
......@@ -44,7 +44,7 @@
<form id="searchForm" class="searchForm navbar-form navbar-left flip" method="get" action="<?=$this->url($basicSearch)?>" name="searchForm" autocomplete="off">
<?= $this->context($this)->renderInContext('search/searchTabs', ['searchTabs' => $searchTabs['tabs']]); ?>
<? $placeholder = $this->searchbox()->getPlaceholderText(isset($searchTabs['selected']['id']) ? $searchTabs['selected']['id'] : null); ?>
<input id="searchForm_lookfor" class="searchForm_lookfor form-control search-query<? if($this->searchbox()->autocompleteEnabled($this->searchClassId)):?> autocomplete searcher:<?=$this->escapeHtmlAttr($this->searchClassId) ?><? endif ?>" type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"<? if ($placeholder): ?> placeholder="<?=$this->transEsc($placeholder) ?>"<? endif ?> autofocus />
<input id="searchForm_lookfor" class="searchForm_lookfor form-control search-query<? if($this->searchbox()->autocompleteEnabled($this->searchClassId)):?> autocomplete searcher:<?=$this->escapeHtmlAttr($this->searchClassId) ?><? endif ?>" type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"<? if ($placeholder): ?> placeholder="<?=$this->transEsc($placeholder) ?>"<? endif ?> />
<? if ($handlerCount > 1): ?>
<select id="searchForm_type" class="searchForm_type form-control" name="type" data-native-menu="false">
<? foreach ($handlers as $handler): ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment