From c3bc294704bcac1da891a9b187e489e2319bb6f7 Mon Sep 17 00:00:00 2001 From: Guillaume Vincent Date: Sat, 7 Apr 2018 22:19:50 +0200 Subject: [PATCH] Change master password field type to 'password' when password is generated Fixes: https://github.com/lesspass/lesspass/issues/217 --- src/components/MasterPassword.vue | 5 ++--- src/views/PasswordGenerator.vue | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/MasterPassword.vue b/src/components/MasterPassword.vue index ff644cb..b72439f 100644 --- a/src/components/MasterPassword.vue +++ b/src/components/MasterPassword.vue @@ -31,8 +31,7 @@ v-bind:value="value" v-bind:placeholder="label" v-on:input="updateValue($event.target.value)" - v-on:keyup.enter="$emit('keyupEnter')" - v-on:blur="hidePassword($refs.passwordField)"> + v-on:keyup.enter="$emit('keyupEnter')"> @@ -99,7 +98,7 @@ } }, hidePassword(element){ - element.type = 'password'; + this.$refs.passwordField.type = 'password'; }, getColor(color) { var colors = ['#000000', '#074750', '#009191', '#FF6CB6', '#FFB5DA', '#490092', '#006CDB', '#B66DFF', '#6DB5FE', '#B5DAFE', '#920000', '#924900', '#DB6D00', '#24FE23']; diff --git a/src/views/PasswordGenerator.vue b/src/views/PasswordGenerator.vue index cdde893..245d64c 100644 --- a/src/views/PasswordGenerator.vue +++ b/src/views/PasswordGenerator.vue @@ -170,11 +170,13 @@ export default { cleanErrors() { clearTimeout(this.cleanTimeout); this.passwordGenerated = ""; + this.$refs.masterPassword.hidePassword(); }, cleanFormInSeconds(seconds = 15) { this.cleanTimeout = setTimeout(() => { this.masterPassword = ""; this.passwordGenerated = ""; + this.$refs.masterPassword.hidePassword(); }, 1000 * seconds); }, generatePassword() {