Skip to content

Commit

Permalink
Revert changes to to scroll bar handling and v-if
Browse files Browse the repository at this point in the history
* Those changes introduced problems with TAB key
  • Loading branch information
Damian Dulisz committed Jun 16, 2016
1 parent 3536dc1 commit 829961e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Multiselect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
tabindex="0"
:class="{ 'multiselect--active': isOpen }"
@focus="activate()"
@blur="searchable ? false : deactivate($event)"
@blur="searchable ? false : deactivate()"
@keydown.self.down.prevent="pointerForward()"
@keydown.self.up.prevent="pointerBackward()"
@keydown.enter.stop.prevent.self="addPointerElement()"
Expand All @@ -28,7 +28,7 @@
v-if="searchable"
v-model="search"
@focus.prevent="activate()"
@blur.prevent="deactivate($event)"
@blur.prevent="deactivate()"
@input="pointerReset()"
@keyup.esc="deactivate()"
@keyup.down="pointerForward()"
Expand All @@ -38,7 +38,7 @@
class="multiselect__input"/>
<span v-if="!searchable && !multiple" class="multiselect__single">{{ getOptionLabel(value) ? getOptionLabel(value) : placeholder }}</span>
</div>
<ul transition="multiselect" :style="{ maxHeight: maxHeight + 'px' }" v-el:list="v-el:list" v-if="isOpen" class="multiselect__content">
<ul transition="multiselect" :style="{ maxHeight: maxHeight + 'px' }" v-el:list="v-el:list" v-show="isOpen" class="multiselect__content">
<slot name="beforeList"></slot>
<li v-for="option in filteredOptions" track-by="$index">
<span
Expand Down
10 changes: 3 additions & 7 deletions src/multiselectMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,7 @@ module.exports = {
* Closes the multiselect’s dropdown.
* Sets this.isOpen to FALSE
*/
deactivate (event) {
if (event && (event.relatedTarget || event.rangeOffset === 1 || (event.rangeParent && event.rangeParent.className === this.$els.tags.className))) {
setTimeout(() => this.$els.search.focus(), 0)
return
}
deactivate () {
/* istanbul ignore else */
if (this.isOpen) {
this.isOpen = false
Expand All @@ -448,8 +444,8 @@ module.exports = {
if (this.searchable) {
this.$els.search.blur()
this.search = this.multiple
? ''
: this.getOptionLabel(this.value)
? ''
: this.getOptionLabel(this.value)
} else {
this.$el.blur()
}
Expand Down

0 comments on commit 829961e

Please sign in to comment.