Skip to content

Commit b736fc1

Browse files
committed
fix count style
1 parent fcd7e08 commit b736fc1

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

lib/TagInput.vue

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ const inputElId = `tag-input${Math.random()}`
121121

122122
<template>
123123
<label :for="inputElId">
124-
<ul class="tags" ref="tagsUl" tabindex="0" :class="{ showCount, duplicate, focused, noMatchingTag, singleLine }">
124+
<ul class="tags" ref="tagsUl" tabindex="0" :class="{ duplicate, focused, noMatchingTag, singleLine }">
125125
<li v-for="(tag, index) in tags" :key="tag" :class="{
126126
duplicate: tag === duplicate,
127127
tag: tagsClass.length == 0,
@@ -142,11 +142,11 @@ const inputElId = `tag-input${Math.random()}`
142142
</option>
143143
</datalist>
144144
</div>
145+
<div v-if="showCount" class="count">
146+
<span>{{ tags.length }}</span> tags
147+
</div>
145148
</ul>
146149
</label>
147-
<div v-if="showCount" class="count">
148-
<span>{{ tags.length }}</span> tags
149-
</div>
150150
<small v-show="noMatchingTag" class="err">Custom tags not allowed</small>
151151
</template>
152152

@@ -226,13 +226,10 @@ input {
226226
}
227227
228228
.count {
229-
position: absolute;
230-
top: 50%;
231-
transform: translateY(-50%);
232-
right: 10px;
233-
display: block;
234229
font-size: 0.8rem;
235230
white-space: nowrap;
231+
flex-grow: 1;
232+
text-align: end;
236233
}
237234
238235
.count span {
@@ -241,10 +238,6 @@ input {
241238
border-radius: 2px;
242239
}
243240
244-
.showCount input {
245-
padding-right: 60px;
246-
}
247-
248241
.err {
249242
color: red;
250243
}

0 commit comments

Comments
 (0)