Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49076

Scroll to top after to digit in a input text

$
0
0

@brunofcosta wrote:

In my APP, on the login view, when I click in the input of the password, for example, the page is scrolled down and I can digit my password, but after that the keyboard is closed, I want that the page scroll to the top.

Is that possible?

Thanks, mates.

My HTML of the login page.

indent preformatted text by 4 spaces








        <div class="spacer" id="spacer1"></div>

        <ion-list>

            <label class="item item-input" ng-class="{ 'has-error' : authenticationForm.username.$invalid}">
                <input type="text" placeholder="Informe seu n&ordm; de matrícula" name="username" ng-model="authentication.username" ng-minlength="6" ng-maxlength="8" required />
            </label>
			<ion-scroll >
            <div class="form-errors" ng-messages="authenticationForm.username.$error">
                <div class="form-error" ng-message="required">Preenchimento obrigatório</div>
                <div class="form-error" ng-message="minlength">Usuário deve conter no minimo 6 caracteres.</div>
                <div class="form-error" ng-message="maxlength">Usuário deve conter no máximo 8 caracteres.</div>
            </div>
			</ion-scroll>


            <label class="item item-input" ng-class="{ 'has-error' : authenticationForm.password.$invalid && authenticationForm.$submitted, 'valid' : authenticationForm.password.$valid && authenticationForm.$submitted}">
                <input type="password" placeholder="Informe sua senha" name="password" ng-model="authentication.password" ng-minlength="6" required />
            </label>

            <div class="form-errors" ng-messages="authenticationForm.password.$error">
                <div class="form-error" ng-message="required">Preenchimento obrigatório</div>
                <div class="form-error" ng-message="minlength">Usuário deve conter no minimo 6 caracteres.</div>
            </div>
		</ion-scroll>

		<ion-scroll>
        <button type="submit" class="button button-positive button-block" ng-disabled="authenticationForm.$invalid">Acessar</button>
		</ion-list>
    </form>

    <div class="row">
        <div class="col text-center">
            <a class="button button-clear button-positive" ui-sref="recuperar" id="bread">Esqueci a minha senha</a>
        </div>
    </div>
</ion-content>


indent preformatted text by 4 spaces

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49076

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>