зеркало из https://github.com/mozilla/kitsune.git
Autofocus the sign-in-step email field for the switching-devices wizard
Fixes mozilla/sumo#1614.
This commit is contained in:
Родитель
6c71e7a764
Коммит
0802db19d4
|
@ -69,6 +69,8 @@ export class SignInStep extends BaseFormStep {
|
|||
this.#formEl.addEventListener("submit", this);
|
||||
this.#emailEl.addEventListener("blur", this);
|
||||
this.#emailEl.addEventListener("input", this);
|
||||
|
||||
this.#emailEl.focus();
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
|
|
|
@ -92,6 +92,11 @@ describe("sign-in-step custom element", () => {
|
|||
assertFormElements(form, EXPECTED_FORM_ELEMENTS_WITH_FLOW_METRICS);
|
||||
});
|
||||
|
||||
it("should focus the email field automatically", () => {
|
||||
let email = step.shadowRoot.querySelector("#email");
|
||||
expect(step.shadowRoot.activeElement).to.equal(email);
|
||||
});
|
||||
|
||||
it("should set an email address if one is set in the state", () => {
|
||||
const TEST_STATE = {
|
||||
utm_source: "utm_source",
|
||||
|
|
Загрузка…
Ссылка в новой задаче