Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
feat(search-box): add autofocus capabilities
Browse files Browse the repository at this point in the history
Closes: #179
  • Loading branch information
rayrutjes committed Jul 19, 2017
1 parent f212155 commit 0c91334
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/SearchBox.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<form role="search" action="" @submit.prevent="onFormSubmit">
<slot>
<ais-input :placeholder="placeholder"></ais-input>
<ais-input :search-store="searchStore" :placeholder="placeholder" :autofocus="autofocus"></ais-input>
<button type="submit" :class="bem('submit')">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 40 40">
<title>{{ submitTitle }}</title>
Expand All @@ -11,7 +11,7 @@
/>
</svg>
</button>
<ais-clear>
<ais-clear :search-store="searchStore">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20">
<title>{{ clearTitle }}</title>
<path
Expand Down Expand Up @@ -43,6 +43,10 @@ export default {
type: String,
default: 'clear',
},
autofocus: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down

0 comments on commit 0c91334

Please sign in to comment.