forked from CIT/Vmeda.Online
		
	MOBILE-3708 core: Deprecate core-auto-focus directive
This commit is contained in:
		
							parent
							
								
									6b8bfbb27b
								
							
						
					
					
						commit
						7dcfc4d989
					
				@ -58,7 +58,7 @@
 | 
			
		||||
                            <ion-label position="stacked">{{ 'addon.mod_lesson.enterpassword' | translate }}</ion-label>
 | 
			
		||||
                            <core-show-password name="password">
 | 
			
		||||
                                <ion-input name="password" type="password" placeholder="{{ 'core.login.password' | translate }}"
 | 
			
		||||
                                    [core-auto-focus] #passwordinput [clearOnEdit]="false">
 | 
			
		||||
                                    [autofocus]="true" #passwordinput [clearOnEdit]="false">
 | 
			
		||||
                                </ion-input>
 | 
			
		||||
                            </core-show-password>
 | 
			
		||||
                        </ion-item>
 | 
			
		||||
 | 
			
		||||
@ -15,7 +15,8 @@
 | 
			
		||||
            <ion-label>{{ 'addon.mod_lesson.enterpassword' | translate }}</ion-label>
 | 
			
		||||
            <core-show-password name="password">
 | 
			
		||||
                <ion-input name="password" type="password" placeholder="{{ 'core.login.password' | translate }}"
 | 
			
		||||
                    [core-auto-focus] #passwordinput [clearOnEdit]="false"></ion-input>
 | 
			
		||||
                    [autofocus]="true" #passwordinput [clearOnEdit]="false">
 | 
			
		||||
                </ion-input>
 | 
			
		||||
            </core-show-password>
 | 
			
		||||
        </ion-item>
 | 
			
		||||
        <ion-button expand="block" type="submit">
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,7 @@
 | 
			
		||||
 | 
			
		||||
        <!-- Form to edit the file's name. -->
 | 
			
		||||
        <ion-input type="text" name="filename" [placeholder]="'core.filename' | translate" autocapitalize="none" autocorrect="off"
 | 
			
		||||
            (click)="$event.stopPropagation()" [core-auto-focus] [(ngModel)]="newFileName" *ngIf="editMode">
 | 
			
		||||
            (click)="$event.stopPropagation()" [autofocus]="true" [(ngModel)]="newFileName" *ngIf="editMode">
 | 
			
		||||
        </ion-input>
 | 
			
		||||
 | 
			
		||||
        <div class="buttons" slot="end" *ngIf="manage">
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
<form #messageForm>
 | 
			
		||||
    <textarea class="core-send-message-input" [core-auto-focus]="showKeyboard" [placeholder]="placeholder" rows="1" core-auto-rows
 | 
			
		||||
    <textarea class="core-send-message-input" [autofocus]="showKeyboard" [placeholder]="placeholder" rows="1" core-auto-rows
 | 
			
		||||
        [(ngModel)]="message" name="message" (onResize)="textareaResized()" (keydown.enter)="enterClicked($event)"
 | 
			
		||||
        (keydown.control.enter)="enterClicked($event, 'control')" (keydown.meta.enter)="enterClicked($event, 'meta')"
 | 
			
		||||
        aria-multiline="true"></textarea>
 | 
			
		||||
@ -10,4 +10,3 @@
 | 
			
		||||
        </ion-button>
 | 
			
		||||
    </ion-buttons>
 | 
			
		||||
</form>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,8 @@ import { CoreUtils } from '@services/utils/utils';
 | 
			
		||||
 * Directive to auto focus an element when a view is loaded.
 | 
			
		||||
 *
 | 
			
		||||
 * You can apply it conditionallity assigning it a boolean value: <ion-input [core-auto-focus]="{{showKeyboard}}">
 | 
			
		||||
 *
 | 
			
		||||
 * @deprecated since 3.9.5. ion-input now supports an [autofocus] attribute, please use that one instead.
 | 
			
		||||
 */
 | 
			
		||||
@Directive({
 | 
			
		||||
    selector: '[core-auto-focus]',
 | 
			
		||||
@ -39,16 +41,7 @@ export class CoreAutoFocusDirective implements OnInit {
 | 
			
		||||
     * Component being initialized.
 | 
			
		||||
     */
 | 
			
		||||
    ngOnInit(): void {
 | 
			
		||||
        // @todo
 | 
			
		||||
        // if (this.navCtrl.isTransitioning()) {
 | 
			
		||||
        //     // Navigating to a new page. Wait for the transition to be over.
 | 
			
		||||
        //     const subscription = this.navCtrl.viewDidEnter.subscribe(() => {
 | 
			
		||||
        //         this.autoFocus();
 | 
			
		||||
        //         subscription.unsubscribe();
 | 
			
		||||
        //     });
 | 
			
		||||
        // } else {
 | 
			
		||||
        this.autoFocus();
 | 
			
		||||
        // }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,7 @@
 | 
			
		||||
                    type="password"
 | 
			
		||||
                    placeholder="{{ 'core.courses.password' | translate }}"
 | 
			
		||||
                    [(ngModel)]="password"
 | 
			
		||||
                    [core-auto-focus]
 | 
			
		||||
                    [autofocus]="true"
 | 
			
		||||
                    [clearOnEdit]="false">
 | 
			
		||||
                </ion-input>
 | 
			
		||||
            </core-show-password>
 | 
			
		||||
 | 
			
		||||
@ -31,7 +31,7 @@
 | 
			
		||||
            <ion-item>
 | 
			
		||||
                <ion-label></ion-label>
 | 
			
		||||
                <ion-input type="text" name="value" placeholder="{{ 'core.login.usernameoremail' | translate }}"
 | 
			
		||||
                    formControlName="value" autocapitalize="none" autocorrect="off" [core-auto-focus]="autoFocus">
 | 
			
		||||
                    formControlName="value" autocapitalize="none" autocorrect="off" [autofocus]="autoFocus">
 | 
			
		||||
                </ion-input>
 | 
			
		||||
            </ion-item>
 | 
			
		||||
            <ion-button type="submit" class="ion-margin" expand="block" [disabled]="!myForm.valid">
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,7 @@
 | 
			
		||||
                    <h2>{{ 'core.login.siteaddress' | translate }}</h2>
 | 
			
		||||
                </ion-label>
 | 
			
		||||
                <ion-input name="url" type="url" placeholder="{{ 'core.login.siteaddressplaceholder' | translate }}"
 | 
			
		||||
                    formControlName="siteUrl" [core-auto-focus]="showKeyboard && !showScanQR">
 | 
			
		||||
                    formControlName="siteUrl" [autofocus]="showKeyboard && !showScanQR">
 | 
			
		||||
                </ion-input>
 | 
			
		||||
            </ion-item>
 | 
			
		||||
        </ng-container>
 | 
			
		||||
@ -37,7 +37,7 @@
 | 
			
		||||
                    <h2>{{ 'core.login.siteaddress' | translate }}</h2>
 | 
			
		||||
                </ion-label>
 | 
			
		||||
                <ion-input name="url" placeholder="{{ 'core.login.siteaddressplaceholder' | translate }}" formControlName="siteUrl"
 | 
			
		||||
                    [core-auto-focus]="showKeyboard && !showScanQR" (ionChange)="searchSite($event, siteForm.value.siteUrl)">
 | 
			
		||||
                    [autofocus]="showKeyboard && !showScanQR" (ionChange)="searchSite($event, siteForm.value.siteUrl)">
 | 
			
		||||
                </ion-input>
 | 
			
		||||
            </ion-item>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@
 | 
			
		||||
        <ion-item>
 | 
			
		||||
            <ion-label></ion-label>
 | 
			
		||||
            <ion-input type="search" name="search" [(ngModel)]="searchText" [placeholder]="placeholder"
 | 
			
		||||
                [autocorrect]="autocorrect" [spellcheck]="spellcheck" [core-auto-focus]="autoFocus"
 | 
			
		||||
                [autocorrect]="autocorrect" [spellcheck]="spellcheck" [autofocus]="autoFocus"
 | 
			
		||||
                [disabled]="disabled" role="searchbox" (ionFocus)="focus($event)">
 | 
			
		||||
            </ion-input>
 | 
			
		||||
            <ion-button slot="end" fill="clear" type="submit" size="small" [attr.aria-label]="searchLabel"
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user