Skip to content

Commit

Permalink
Get rid of the clear option
Browse files Browse the repository at this point in the history
This break some stuff and make this component harder to maintain so, I'm going to rid of this for now until I can figure out a better way to integrate it.
  • Loading branch information
DannyFeliz committed Jan 26, 2020
1 parent f6fd9e3 commit bb142c5
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions src/components/EmailDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ref="email"
type="email"
:value="email"
:class="[inputClasses, {'is-clearable' : isClearable}]"
:class="inputClasses"
@focus="handleEmailInputFocus"
@input="handleInputEvent"
@keyup.up="handleListNavigation('up')"
Expand All @@ -17,9 +17,6 @@
autocomplete="off"
autocapitalize="off"
/>
<button v-if="isClearable" @click="clearInput" tabindex="-1">
<span>&times;</span>
</button>
</div>
<div :class="emailDropdownContainerClasses">
<ul v-if="shouldShowList" class="email-dropdown-list">
Expand Down Expand Up @@ -90,10 +87,6 @@ export default {
inputClasses: {
type: [String, Array, Object],
default: ""
},
clearable: {
type: Boolean,
default: false
}
},
data() {
Expand Down Expand Up @@ -124,8 +117,7 @@ export default {
emailDropdownContainerClasses() {
return {
"email-dropdown-list-container": true,
hide: this.hasclickedOutside,
"is-clearable": this.isClearable
hide: this.hasclickedOutside
};
},
domain() {
Expand Down Expand Up @@ -154,9 +146,6 @@ export default {
.filter(domain => domain.startsWith(this.domain))
.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
.slice(0, this.maxSuggestions);
},
isClearable() {
return Boolean(this.clearable && this.email.trim());
}
},
watch: {
Expand Down Expand Up @@ -244,10 +233,6 @@ export default {
}
return shouldFocus;
},
clearInput() {
this.email = "";
this.$refs.email.focus();
}
}
};
Expand All @@ -271,11 +256,6 @@ export default {
width: 100%;
padding-right: 0;
margin-right: -4px;
&.is-clearable {
padding-right: 13px;
margin-right: 0;
}
}
button {
Expand All @@ -296,10 +276,6 @@ export default {
position: relative;
height: 0;
&.is-clearable {
margin-right: -4px;
}
&.hide {
display: none;
}
Expand Down

0 comments on commit bb142c5

Please sign in to comment.