diff --git a/.travis.yml b/.travis.yml
index d1959fd..690e9ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,3 +6,4 @@ node_js:
script:
- yarn test --coverage --coverageReporters=text-lcov | coveralls
+ - yarn build && bundlewatch --max-size 20kb ./dist/!(*.map)
diff --git a/docs/.vuepress/components/CustomHandlers.vue b/docs/.vuepress/components/CustomHandlers.vue
new file mode 100644
index 0000000..8fa43e8
--- /dev/null
+++ b/docs/.vuepress/components/CustomHandlers.vue
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/docs/.vuepress/components/TagOnComma.vue b/docs/.vuepress/components/TagOnComma.vue
new file mode 100644
index 0000000..59e1d6a
--- /dev/null
+++ b/docs/.vuepress/components/TagOnComma.vue
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js
index 583ba3d..1f2e6a0 100644
--- a/docs/.vuepress/config.js
+++ b/docs/.vuepress/config.js
@@ -123,6 +123,13 @@ module.exports = {
['guide/loops', 'Using in Loops'],
],
},
+ {
+ title: 'Customizing',
+ collapsable: false,
+ children: [
+ ['guide/keydown', 'Keydown Events'],
+ ],
+ },
{
title: 'API',
collapsable: false,
diff --git a/docs/guide/keydown.md b/docs/guide/keydown.md
new file mode 100644
index 0000000..b353960
--- /dev/null
+++ b/docs/guide/keydown.md
@@ -0,0 +1,73 @@
+### Customizing Keydown Behaviour
+---
+
+## selectOnKeyCodes
+
+`selectOnKeyCodes {Array}` is an array of keyCodes that will trigger a typeAheadSelect. Any keyCodes
+ in this array will prevent the default event action and trigger a typeahead select. By default,
+ it's just `[13]` for return. For example, maybe you want to tag on a comma keystroke:
+
+
+
+<<< @/.vuepress/components/TagOnComma.vue
+
+## mapKeyDown
+
+Vue Select provides the `map-keydown` Function prop to allow for customizing the components response to
+keydown events while the search input has focus.
+
+```js
+/**
+ * @param map {Object} Mapped keyCode to handlers { : }
+ * @param vm {VueSelect}
+ * @return {Object}
+ */
+(map, vm) => map,
+```
+
+By default, the prop is a no–op returning the same object `map` object it receives. This object
+maps keyCodes to handlers: `{ : }`. Modifying this object can override default
+functionality, or add handlers for different keys that the component doesn't normally listen for.
+
+Note that any keyCodes you've added to `selectOnKeyCodes` will be passed to `map-keydown` as well,
+so `map-keydown` will always take precedence.
+
+**Default Handlers**
+
+```js
+// delete
+8: e => this.maybeDeleteValue()
+
+// tab
+9: e => this.onTab()
+
+// enter
+13: e => {
+ e.preventDefault();
+ return this.typeAheadSelect();
+}
+
+// esc
+27: e => this.onEscape()
+
+// up
+38: e => {
+ e.preventDefault();
+ return this.typeAheadUp();
+}
+
+// down
+40: e => {
+ e.preventDefault();
+ return this.typeAheadDown();
+}
+```
+
+### Example: Autocomplete Email Addresses
+
+This is example listens for the `@` key, and autocompletes an email address with `@gmail.com`.
+
+
+
+<<< @/.vuepress/components/CustomHandlers.vue
+
diff --git a/docs/guide/upgrading.md b/docs/guide/upgrading.md
index e16128a..db720e2 100644
--- a/docs/guide/upgrading.md
+++ b/docs/guide/upgrading.md
@@ -69,10 +69,10 @@ has always provided the same parameters and can be used in it's place.
```
-### `onSearch` with null search string
+### `@search` with null search string
-The `onSearch` callback is now fired anytime the search string changes. In v2.x, the component
-would first check if the search string was empty, and only run the callback if it had at least one
+The `@search` event is now fired anytime the search string changes. In v2.x, the component
+would first check if the search string was empty, and only emit the event if it had at least one
character. This was a design mistake, as it should be the consumers decision if a search should be
run on an empty string.
diff --git a/package.json b/package.json
index deefd80..beb7fd1 100644
--- a/package.json
+++ b/package.json
@@ -39,6 +39,7 @@
"autoprefixer": "^9.4.7",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.5",
+ "bundlewatch": "^0.2.5",
"chokidar": "^2.1.5",
"coveralls": "^3.0.2",
"cross-env": "^5.2.0",
diff --git a/src/components/Select.vue b/src/components/Select.vue
index 9ef97c6..047fcb3 100644
--- a/src/components/Select.vue
+++ b/src/components/Select.vue
@@ -20,7 +20,7 @@
-