Skip to content
Browse files

Issue #1381: Autofocus on Email field on Login page

Wrote a simple test to check for the autofocus attribute on the Login page -
there isn't another way to check for this behaviour using SimpleTest as far as I can tell.

Added the attribute to the user field on the login page. All compatible browsers
will accept this.

Closes #1381, closes #1399
  • Loading branch information...
1 parent 052d96c commit 3293fe88055d0160afea0f4e56bf4991d0772ca3 @sarcas sarcas committed with
Showing with 7 additions and 2 deletions.
  1. +6 −1 tests/WebTestOfLogin.php
  2. +1 −1 webapp/_lib/view/session.login.tpl
View
7 tests/WebTestOfLogin.php
@@ -94,4 +94,9 @@ public function testLoginLockout() {
$i = $i + 1;
}
}
-}
+
+ public function testAutofocusOnUserField() {
+ $this->get($this->url.'/session/login.php');
+ $this->assertPattern('/autofocus="autofocus"/');
+ }
+}
View
2 webapp/_lib/view/session.login.tpl
@@ -22,7 +22,7 @@
</label>
</div>
<div class="grid_10 left">
- <input type="text" name="email" id="email"{if isset($email)} value="{$email|filter_xss}"{/if}>
+ <input type="text" name="email" id="email"{if isset($email)} value="{$email|filter_xss}"{/if} autofocus="autofocus">
</div>
</div>
<div class="clearfix">

0 comments on commit 3293fe8

Please sign in to comment.
Something went wrong with that request. Please try again.