Fix account selection garbage

This commit is contained in:
Sol Fisher Romanoff 2022-06-16 08:25:09 +03:00
parent cf33b3295f
commit d1af4bdd51
No known key found for this signature in database
GPG key ID: 9D3F2B64F2341B62
4 changed files with 18 additions and 12 deletions

View file

@ -57,15 +57,16 @@ const ListNew = {
onInput () {
this.search(this.query)
},
selectUser (user, event) {
selectUser (user) {
if (this.selectedUserIds.includes(user.id)) {
this.removeUser(user.id)
event.target.classList.remove('selected')
} else {
this.addUser(user)
event.target.classList.add('selected')
}
},
isSelected (user) {
return this.selectedUserIds.includes(user.id)
},
addUser (user) {
this.selectedUserIds.push(user.id)
},

View file

@ -41,9 +41,11 @@
:key="user.id"
class="member"
>
<div @click.capture.prevent="selectUser(user, $event)">
<BasicUserCard :user="user" />
</div>
<BasicUserCard
:user="user"
:class="isSelected(user) ? 'selected' : ''"
@click.capture.prevent="selectUser(user)"
/>
</div>
</div>
<button

View file

@ -51,15 +51,16 @@ const ListNew = {
onInput () {
this.search(this.query)
},
selectUser (user, event) {
selectUser (user) {
if (this.selectedUserIds.includes(user.id)) {
this.removeUser(user.id)
event.target.classList.remove('selected')
} else {
this.addUser(user)
event.target.classList.add('selected')
}
},
isSelected (user) {
return this.selectedUserIds.includes(user.id)
},
addUser (user) {
this.selectedUserIds.push(user.id)
},

View file

@ -41,9 +41,11 @@
:key="user.id"
class="member"
>
<div @click.capture.prevent="selectUser(user, $event)">
<BasicUserCard :user="user" />
</div>
<BasicUserCard
:user="user"
:class="isSelected(user) ? 'selected' : ''"
@click.capture.prevent="selectUser(user)"
/>
</div>
</div>
<button