mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 04:59:40 +00:00
Nicer input event handler
This commit is contained in:
parent
1bcf2dfe80
commit
8db2fb8015
1 changed files with 5 additions and 1 deletions
|
|
@ -29,7 +29,7 @@
|
||||||
:class="{
|
:class="{
|
||||||
'input-valid': invite.valid, 'is-invalid input-invalid': invite.valid === false}"
|
'input-valid': invite.valid, 'is-invalid input-invalid': invite.valid === false}"
|
||||||
@keyup="expandInviteList"
|
@keyup="expandInviteList"
|
||||||
@input="checkInviteList(); clearErrors(invite);"
|
@input="inviteUpdated(invite)"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -158,6 +158,10 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
inviteUpdated (invite) {
|
||||||
|
this.clearErrors(invite);
|
||||||
|
this.checkInviteList();
|
||||||
|
},
|
||||||
checkInviteList: debounce(function checkList () {
|
checkInviteList: debounce(function checkList () {
|
||||||
this.invites = this.invites.filter(
|
this.invites = this.invites.filter(
|
||||||
(invite, index) => invite.text.length > 0 || index === this.invites.length - 1,
|
(invite, index) => invite.text.length > 0 || index === this.invites.length - 1,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue