Skip to content

Commit

Permalink
fix: wt-select allow-custom-value input and close methods order swapp…
Browse files Browse the repository at this point in the history
…ed [WTEL-3181]
  • Loading branch information
dlohvinov committed Feb 4, 2024
1 parent 260a5f7 commit 4d7c47f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 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.2.42",
"version": "24.2.43",
"private": false,
"scripts": {
"dev": "vite",
Expand Down
20 changes: 18 additions & 2 deletions src/components/wt-select/wt-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,25 @@ export default {
},
methods: {
// for taggableMixin functionality
handleCustomValue(toggle) {
toggle();
async handleCustomValue(toggle) {
/**
* tag emits input event, but there is a drawback
* there are causes, when input handler is async, but close event, emitted by toggle(),
* is performing some operations with input value.
* filter selects (abstract-enum(api)-filter.vue) for instance
*
* 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);
// 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();
},
// for taggableMixin functionality
emitTagEvent(searchQuery, id) {
Expand Down

0 comments on commit 4d7c47f

Please sign in to comment.