From 601d442b785e1834e609dd8a78bbc43f3843b77b Mon Sep 17 00:00:00 2001 From: Alexander Zavyalov Date: Sun, 1 Mar 2020 12:54:25 +0800 Subject: [PATCH] Fixed a focusing issue Adding .active class to the wrapper element when input field is focused --- README.md | 21 ++++++++++++++++++--- dist/style.css | 6 ++++++ src/VoerroTagsInput.vue | 25 +++++++++++++++++++------ 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 624a080..a35303b 100644 --- a/README.md +++ b/README.md @@ -269,18 +269,33 @@ wrapper-class | tags-input-wrapper-default | Outer appearance of the input - a w When search results are displayed underneath the input, use the `arrow down` and `arrow up` keys on the keyboard to move the selection. Press `Enter` to select a tag. Press `Esc` to discard the search results and then `Enter` to add a new tag the way you've typed it. -## Updating From Older Versions +## Breaking Changes -#### Older versions up to v1.5.0 -> v1.5.1 +#### v1.0.0 ... v1.5.0 -> v1.5.1 See the `v1` branch for details. #### v1.5.1 and above -> v2.* -A pretty serious bug (#53) was fixed in `v2.0.0`. The data format for the `existing-tags` prop and the `v-model` directive has been changed. You can find the new format in this documentation, see above. +A pretty serious bug ([#53](../../issues/53)) was fixed in `v2.0.0`. The data format for the `existing-tags` prop and the `v-model` directive has been changed. You can find the new format in this documentation, see above. ## Changelog +#### v.2.2.0 + +- New option: `hide-input-on-limit` +- New option: `typeahead-show-on-focus`. It is enabled by default and will make the typeahead (badges or dropdown) visible whenever the input field is focused and if there are any tags suggestions. +- Adding `active` class to the wrapper element when the input field is focused. If you're using the default (provided) `style.css` file, note that your tags input will now get a "glow" around it when focused. + +#### v.2.1.0 + +- New option: `typeahead-always-show` +- New option: `typeahead-hide-discard` +- New option: `add-tags-on-space` +- New event: `change` +- "Discard Search Results" string (option text) is now customizable +- Fixed a minor bug with removing tags on backspace press + #### v.2.0.2 - Fix: [#43](../../issues/43) diff --git a/dist/style.css b/dist/style.css index a30d1fc..4f51f46 100644 --- a/dist/style.css +++ b/dist/style.css @@ -29,6 +29,12 @@ border-color: #dbdbdb; } +.tags-input-wrapper-default.active { + border: 1px solid #8bbafe; + box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25); + outline: 0 none; +} + /* The tag badges & the remove icon */ .tags-input span { margin-right: 0.3rem; diff --git a/src/VoerroTagsInput.vue b/src/VoerroTagsInput.vue index aa7061f..fb254c4 100644 --- a/src/VoerroTagsInput.vue +++ b/src/VoerroTagsInput.vue @@ -1,6 +1,9 @@