Просмотр исходного кода

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 лет назад
Родитель
Сommit
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>