mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-13 14:39:52 +03:00
Autofocus on input fields after routing
closes #3538, closes #3541 - The “autofocus” property isn’t considered by browsers if the element is created after the page has been loaded. The Ember cookbook recommends extending the input type with a manually triggered autofocus, which I included here. - This introduces the new helper “gh-focus-input”, an input field gaining focus even when routing occurs.
This commit is contained in:
parent
d35598457b
commit
be683e3d4b
@ -1,7 +1,8 @@
|
||||
<section class="forgotten-box js-forgotten-box fade-in">
|
||||
<form id="forgotten" class="forgotten-form" method="post" novalidate="novalidate">
|
||||
<div class="email-wrap">
|
||||
{{input value=email class="email" type="email" placeholder="Email Address" name="email" autofocus="autofocus" autocapitalize="off" autocorrect="off"}}
|
||||
{{gh-trim-focus-input value=email class="email" type="email" placeholder="Email Address" name="email"
|
||||
autofocus="autofocus" autocapitalize="off" autocorrect="off"}}
|
||||
</div>
|
||||
<button class="button-save" type="submit" {{action "submit"}} {{bind-attr disabled=submitting}}>Send new password</button>
|
||||
</form>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<section class="login-box js-login-box fade-in">
|
||||
<form id="login" class="login-form" method="post" novalidate="novalidate" {{action 'validateAndAuthenticate' on='submit'}}>
|
||||
<div class="email-wrap">
|
||||
{{input class="email" type="email" placeholder="Email Address" name="identification" autofocus="autofocus" autocapitalize="off" autocorrect="off" value=identification}}
|
||||
{{gh-trim-focus-input class="email" type="email" placeholder="Email Address" name="identification" autofocus="autofocus"
|
||||
autocapitalize="off" autocorrect="off" value=identification}}
|
||||
</div>
|
||||
<div class="password-wrap">
|
||||
{{input class="password" type="password" placeholder="Password" name="password" value=password}}
|
||||
|
@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name">Full Name</label>
|
||||
{{input type="text" name="name" autofocus="autofocus" autocorrect="off" value=name }}
|
||||
{{gh-trim-focus-input type="text" name="name" autofocus="autofocus" autocorrect="off" value=name }}
|
||||
<p>The name that you will sign your posts with</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
Loading…
Reference in New Issue
Block a user