Skip to content

Commit

Permalink
24.04.25: wt-select custom value arrow [WTEL-4462]
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohvinov committed Apr 17, 2024
1 parent ee8d964 commit a28d1d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webitel/ui-sdk",
"version": "24.4.24",
"version": "24.4.25",
"private": false,
"scripts": {
"dev": "vite",
Expand Down
27 changes: 15 additions & 12 deletions src/components/wt-select/wt-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,18 @@
<template #caret="{ toggle }">
<!-- In mode allowCustomValues, adding is done by clicking on this icon -->
<!-- [https://my.webitel.com/browse/WTEL-3181]-->
<!-- <wt-icon-btn-->
<!-- v-if="allowCustomValues && searchParams.search"-->
<!-- :disabled="disabled"-->
<!-- class="multiselect__select multiselect__custom-value"-->
<!-- icon="select-custom-value-enter"-->
<!-- @mousedown.prevent-->
<!-- @click="handleCustomValue(toggle)"-->
<!-- />-->
<wt-icon-btn

Check warning on line 89 in src/components/wt-select/wt-select.vue

View workflow job for this annotation

GitHub Actions / Qodana for JS

Missing component import

Component wt-icon-btn is not imported
v-if="allowCustomValues && searchParams.search"
:disabled="disabled"
class="multiselect__select multiselect__custom-value"
icon="select-custom-value-enter"
@mousedown.prevent
@click="handleCustomValueArrowInput(toggle)"
/>
<!-- To view a list of possible values, click on this icon -->
<!-- @mousedown.native.prevent.stop="toggle": https://github.com/shentao/vue-multiselect/issues/1204#issuecomment-615114727 -->
<wt-icon-btn

Check warning on line 99 in src/components/wt-select/wt-select.vue

View workflow job for this annotation

GitHub Actions / Qodana for JS

Missing component import

Component wt-icon-btn is not imported
v-else
:disabled="disabled"
class="multiselect__select multiselect__arrow"
icon="arrow-down"
Expand Down Expand Up @@ -233,8 +234,10 @@ export default {
async handleCustomValue(value) {
// https://webitel.atlassian.net/browse/WTEL-3181
this.tag(value);
},
// for taggableMixin functionality
async handleCustomValueArrowInput(toggle) {
// https://webitel.atlassian.net/browse/WTEL-3181
// OLD CODE, but can be useful in future
/**
* tag emits input event, but there is a drawback
Expand All @@ -245,15 +248,15 @@ export default {
* for now, i've tested this cause and it works well even without waiting for $nextTick()
* however, this is a potential problem, so, i've left this comment here
*/
// this.tag(this.searchParams.search);
this.tag(this.searchParams.search);
// await this.$nextTick();
/**
* call toggle strictly after tag() method because tag() emits input,
* because there could be code, which performs operation with input only after select close
* so that, it's crucial to emit input before close
*/
// toggle();
toggle();
},
// for taggableMixin functionality
emitTagEvent(searchQuery, id) {
Expand Down

0 comments on commit a28d1d4

Please sign in to comment.