0

In below code, Password suggestion tooltip is open when keydown event is fire.But i want show suggestion tooltip on focus of ion-input element.

HTML

<label class="ci-ter-head ci-opc-50 ci-required">Password</label>
                              <ion-input type="{{feildType}}"  class="inputField" onFocus="passwordKeydown($event, 'signUpForm')"  [ngClass]="{'close-icon': validationVaribles.errorIconPassword, 'right-icon' : validationVaribles.successIconPassword }" [(ngModel)]="userSignUpInfo.password"
                              class="ci-form-field ci-sec-head">
                              <span *ngIf="!platform.is('ios')" [hidden] = "shPassword" (click)="showPassword($event);" style="margin-right: 5px;height: 28px;"><img src="../../assets/images/show.svg" height="28"></span>
                              <span *ngIf="!platform.is('ios')" [hidden] = "!shPassword" (click)="showPassword($event);" style="margin-right: 5px;height: 28px;"><img src="../../assets/images/hide.svg" height="28"></span>
                              </ion-input>
                              <div [ngClass]="commonService.onResize() ? 'ci-box-shadow' : 'ci-box-shadow'" *ngIf="passwordcomplexityHidden && userSignUpInfo.password != ''">
                                <ul>
                                  <li *ngIf="passwordcomplexity.isMinLen == false" class="ci-pt-5 ci-pb-5 ci-pl-10">- Be at least eight characters long</li>
                                  <li *ngIf="passwordcomplexity.isCapital == false" class="ci-pt-5 ci-pb-5 ci-pl-10">- Contain at least one uppercase letter </li>
                                  <li *ngIf="passwordcomplexity.isSmall == false" class="ci-pt-5 ci-pb-5 ci-pl-10">- Contain at least one lowercase letter</li>
                                  <li *ngIf="passwordcomplexity.isNumber == false" class="ci-pt-5 ci-pb-5 ci-pl-10">- Contain at least one numbers</li>
                                  <li *ngIf="passwordcomplexity.isSpecial == false" class="ci-pt-5 ci-pb-5 ci-pl-10">- Contain at least one special character</li>
                                </ul>
                              </div>

1 Answer 1

0

use ionFocus to set a property to show hide tooltip <-> *ngIf, you should mention what ionic version do you use.

.html

<ion-input type="password" [(ngModel)]="password" (ionFocus)="focus()" (ionBlur)="focusOut()"></ion-input>

.ts

focus(){
  this.showTooltip = true;
}

focusOut(){
  this.showTooltip = false;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.