Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase authored Dec 11, 2020
2 parents 95d67cc + 68a18d5 commit abf7996
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core/src/components/cv-data-table/cv-data-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
@keydown.enter.prevent="checkSearchExpand(true)"
@keydown.space.prevent
@keyup.space.prevent="checkSearchExpand(true)"
@blur="checkSearchFocus"
ref="magnifier"
>
<Search16 :class="`${carbonPrefix}--toolbar-action__icon`" />
Expand All @@ -65,7 +64,6 @@
ref="search"
v-model="searchValue"
@input="onSearch"
@blur="checkSearchFocus"
@keydown.esc.prevent="checkSearchExpand(false)"
/>
<button
Expand Down Expand Up @@ -271,9 +269,19 @@ export default {
this.$on('cv:sort', (srcComponent, value) => this.onSort(srcComponent, value));
},
mounted() {
if (this.$refs.searchContainer) {
this.$refs.magnifier.addEventListener('blur', this.checkSearchFocus);
this.$refs.search.addEventListener('blur', this.checkSearchFocus);
}
this.updateRowsSelected();
this.checkSlots();
},
beforeDestroy() {
if (this.$refs.searchContainer) {
this.$refs.magnifier.removeEventListener('blur', this.checkSearchFocus);
this.$refs.search.removeEventListener('blur', this.checkSearchFocus);
}
},
updated() {
this.checkSlots();
},
Expand Down

0 comments on commit abf7996

Please sign in to comment.