浏览代码

Add autofocus attribute on search input

I added the autofocus HTML5 attribute on search input, so that we can
avoid the "boring" mouse click on page load to select the search field.
Matthieu Moquet 12 年之前
父节点
当前提交
4e1e741496
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Packagist/WebBundle/Resources/views/Web/searchForm.html.twig

+ 1 - 1
src/Packagist/WebBundle/Resources/views/Web/searchForm.html.twig

@@ -2,7 +2,7 @@
     <p class="submit-wrapper"><input class="submit" type="submit" value="Search" /></p>
     <p>
         {{ form_errors(searchForm.query) }}
-        {{ form_widget(searchForm.query, {'attr': {'autocomplete': 'off', 'placeholder': 'Search packages...', 'tabindex': 1}}) }}
+        {{ form_widget(searchForm.query, {'attr': {'autocomplete': 'off', 'autofocus': 'autofocus', 'placeholder': 'Search packages...', 'tabindex': 1}}) }}
         {{ form_rest(searchForm) }}
     </p>
 </form>