Skip to content

Commit

Permalink
feat: focus 1st input on OTP
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe committed Dec 18, 2023
1 parent 064a63a commit 24ef301
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/reader-activation/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ window.newspackRAS.push( function ( readerActivation ) {
emailAddressElements.forEach( element => {
element.textContent = readerActivation.getReader()?.email || '';
} );
// Focus on the first input.
const firstInput = container.querySelector( '.otp-field input[type="text"]' );
if ( firstInput ) {
firstInput.focus();
}
}
if ( [ 'link', 'pwd' ].includes( action ) ) {
readerActivation.setAuthStrategy( action );
Expand Down

0 comments on commit 24ef301

Please sign in to comment.