Skip to content

Commit

Permalink
fix: Continuously pressing enter shows empty tags (#6314)
Browse files Browse the repository at this point in the history
When on a contact page, and adding tags, after adding the first tag,
continuously pressing enter adds "empty" tags to the UI.

Seems to be introduced by a fix of QA tool issues in
57b31f6

Before this change `this.search != ''` evaluated to true if search was `null`,
with a strict comparison that is no longer the case.
The `this.search` is reset to `null` though in some cases.

I thought about simply extending the condition to also check for `!== null`,
though imho the better solution would be to always reset it to empty string
state, as is the default value. That also matches some click handler value,
and is generally both the value on "non-changed" and on "changed but empty".

fixes #6235
  • Loading branch information
particleflux authored Oct 16, 2022
1 parent b4c1c03 commit 2386096
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/js/components/people/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export default {
});
this.arrowCounter = -1;
this.isOpen = false;
this.search = null;
this.search = '';
this.store();
}
},
Expand All @@ -183,11 +183,11 @@ export default {
onEscape() {
this.arrowCounter = -1;
this.isOpen = false;
this.search = null;
this.search = '';
},
setResult(result) {
this.search = null;
this.search = '';
this.isOpen = false;
this.contactTags.push(result);
this.store();
Expand Down

0 comments on commit 2386096

Please sign in to comment.