Skip to content

Commit 303e3a9

Browse files
committed
fixes tag margin. fixes input position on multiple select
1 parent 5a5101e commit 303e3a9

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

src/resources/assets/js/components/enso/select/Tag.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export default {
3232
margin-bottom: 0;
3333
}
3434
35-
&:not(:first-child) {
36-
margin-left: 0.3em;
35+
&:not(:last-child) {
36+
margin-right: 0.3em;
3737
}
3838
3939
.tag {

src/resources/assets/js/components/enso/select/VueSelect.vue

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@
99
@click="showDropdown"
1010
@focus="showDropdown">
1111
<div class="select-value">
12-
<div class="field is-grouped is-grouped-multiline"
13-
v-if="multiple">
14-
<div class="control">
12+
<div class="field is-grouped is-grouped-multiline">
13+
<div class="control"
14+
v-if="multiple">
1515
<tag v-for="(option, index) in selected"
1616
:disabled="disabled"
1717
:label="option[label]"
1818
:key="index"
19-
@remove="remove(option);"/>
19+
@remove="remove(option[trackBy]); $emit('remove', option)"/>
2020
</div>
21+
<input class="input select-input" type="text"
22+
v-focus
23+
:placeholder="i18n(placeholder)"
24+
v-model="query"
25+
@keydown.esc="hideDropdown"
26+
@keydown.down="keyDown"
27+
@keydown.up="keyUp"
28+
@keydown.tab="hideDropdown"
29+
@keydown.enter.prevent="hit()"
30+
v-if="dropdown">
2131
</div>
2232
<span v-if="!dropdown && !(multiple && hasSelection)">
2333
{{ hasSelection
2434
? selected
2535
: (optionList.length > 0 ? i18n(placeholder) : i18n(labels.noOptions))
2636
}}
2737
</span>
28-
<input class="input select-input" type="text"
29-
v-focus
30-
:placeholder="i18n(placeholder)"
31-
v-model="query"
32-
v-if="dropdown"
33-
@keydown.esc="hideDropdown"
34-
@keydown.down="keyDown"
35-
@keydown.up="keyUp"
36-
@keydown.tab="hideDropdown"
37-
@keydown.enter.prevent="hit()">
3838
<span class="is-loading"
3939
v-if="loading"/>
4040
<a class="delete is-small"
@@ -366,12 +366,10 @@ export default {
366366
highlight(label) {
367367
return label.replace(new RegExp(`(${this.query})`, 'gi'), '<b>$1</b>');
368368
},
369-
remove(option) {
369+
remove(value) {
370370
const index = this.value
371-
.findIndex(val => val === option[this.trackBy]);
371+
.findIndex(val => val === value);
372372
this.value.splice(index, 1);
373-
this.$emit('remove', option);
374-
this.$emit('input', this.value);
375373
},
376374
isSelected(option) {
377375
return this.multiple

0 commit comments

Comments
 (0)