When the user open the pop up of the web extension, site field is automatically populated with the base domain name. On site https://www.example.org/ site field become www.example.org. Some users use example.org, some other example only, some users a custom site. It's easy now to: - remove the site by hitting backspace - or hitting arrow down to get the first entry: example - or hitting arrow down x 2 to get example.org - or hitting tab to keep www.example.org and go on login Fixes: https://github.com/lesspass/lesspass/issues/386 Fixes: https://github.com/lesspass/lesspass/issues/439pull/448/head
@@ -9,7 +9,7 @@ describe("Connected Mode", function() { | |||||
cy.get("#fingerprint .fa-btc").should("be.visible"); | cy.get("#fingerprint .fa-btc").should("be.visible"); | ||||
cy.get("#fingerprint .fa-subway").should("be.visible"); | cy.get("#fingerprint .fa-subway").should("be.visible"); | ||||
cy.get("#signInButton").click(); | cy.get("#signInButton").click(); | ||||
cy.get("#siteField").type("lesspass.com"); | |||||
cy.get("#siteField").type("lesspass.com").blur(); | |||||
cy.get("#login").type("test@lesspass.com"); | cy.get("#login").type("test@lesspass.com"); | ||||
cy.get("#passwordField").type("test@lesspass.com"); | cy.get("#passwordField").type("test@lesspass.com"); | ||||
cy.get("#generatePassword__btn").click(); | cy.get("#generatePassword__btn").click(); | ||||
@@ -19,7 +19,7 @@ describe("Password Generation", function() { | |||||
} | } | ||||
cy.visit("/"); | cy.visit("/"); | ||||
cy.get("#siteField").type("lesspass.com"); | |||||
cy.get("#siteField").type("lesspass.com").blur(); | |||||
cy.get("#login").type("test@lesspass.com"); | cy.get("#login").type("test@lesspass.com"); | ||||
cy.get("#passwordField").type("test@lesspass.com"); | cy.get("#passwordField").type("test@lesspass.com"); | ||||
cy.wait(500); | cy.wait(500); | ||||
@@ -105,7 +105,7 @@ describe("Password Generation", function() { | |||||
}); | }); | ||||
it("should generate password when hit enter nrt_266", function() { | it("should generate password when hit enter nrt_266", function() { | ||||
cy.visit("/"); | cy.visit("/"); | ||||
cy.get("#siteField").type("lesspass.com"); | |||||
cy.get("#siteField").type("lesspass.com").blur(); | |||||
cy.get("#login").type("test@lesspass.com"); | cy.get("#login").type("test@lesspass.com"); | ||||
cy.get("#passwordField") | cy.get("#passwordField") | ||||
.type("test@lesspass.com") | .type("test@lesspass.com") | ||||
@@ -129,7 +129,7 @@ describe("Password Generation", function() { | |||||
}); | }); | ||||
it("should clear password generated when master password change", function() { | it("should clear password generated when master password change", function() { | ||||
cy.visit("/"); | cy.visit("/"); | ||||
cy.get("#siteField").type("example.org"); | |||||
cy.get("#siteField").type("example.org").blur(); | |||||
cy.get("#login").type("user"); | cy.get("#login").type("user"); | ||||
cy.get("#passwordField").type("password"); | cy.get("#passwordField").type("password"); | ||||
cy.get("#generatePassword__btn").should("be.visible"); | cy.get("#generatePassword__btn").should("be.visible"); | ||||
@@ -38,7 +38,9 @@ | |||||
} | } | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
this.awesomplete = new Awesomplete(this.$refs.siteField); | |||||
this.awesomplete = new Awesomplete(this.$refs.siteField,{ | |||||
minChars: 0, | |||||
}); | |||||
this.awesomplete.item = (element, input) => { | this.awesomplete.item = (element, input) => { | ||||
let item = Awesomplete.ITEM(element.value.site, input); | let item = Awesomplete.ITEM(element.value.site, input); | ||||
item.innerHTML += ` ${element.value.login}`; | item.innerHTML += ` ${element.value.login}`; | ||||
@@ -80,6 +82,8 @@ | |||||
return {site: suggestion, suggestion: true, login: ''} | return {site: suggestion, suggestion: true, login: ''} | ||||
}); | }); | ||||
this.awesomplete.list = this.passwords.concat(suggestions); | this.awesomplete.list = this.passwords.concat(suggestions); | ||||
this.awesomplete.evaluate(); | |||||
this.awesomplete.open(); | |||||
} | } | ||||
}, | }, | ||||
methods: {} | methods: {} | ||||
@@ -227,16 +227,19 @@ export default { | |||||
}); | }); | ||||
}, | }, | ||||
focusBestInputField() { | focusBestInputField() { | ||||
try { | |||||
const site = this.$refs.site.$refs.siteField; | |||||
const login = this.$refs.login; | |||||
const masterPassword = this.$refs.masterPassword; | |||||
if (site && !site.value) return void site.focus(); | |||||
if (login && !login.value) return void login.focus(); | |||||
masterPassword.$refs.passwordField.focus(); | |||||
} | |||||
catch(err) { | |||||
console.error("Can't focus password field") | |||||
const site = this.$refs.site; | |||||
const login = this.$refs.login; | |||||
const masterPassword = this.$refs.masterPassword; | |||||
if (site && login && masterPassword){ | |||||
const siteField = site.$refs.siteField; | |||||
if (siteField.value && login.value){ | |||||
return void masterPassword.$refs.passwordField.focus(); | |||||
} | |||||
if (siteField.value && !login.value){ | |||||
return void siteField.select(); | |||||
}else{ | |||||
return void siteField.focus(); | |||||
} | |||||
} | } | ||||
}, | }, | ||||
copyPassword() { | copyPassword() { | ||||