mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
fix(input): change next input imports
This commit is contained in:
@ -9,7 +9,7 @@ import {IonicApp} from '../app/app';
|
|||||||
import {Label} from '../label/label';
|
import {Label} from '../label/label';
|
||||||
import {pointerCoord, hasPointerMoved, closest} from '../../util/dom';
|
import {pointerCoord, hasPointerMoved, closest} from '../../util/dom';
|
||||||
import {NavController} from '../nav/nav-controller';
|
import {NavController} from '../nav/nav-controller';
|
||||||
import {NativeInput} from './native-input';
|
import {NativeInput, NextInput} from './native-input';
|
||||||
import {Platform} from '../../platform/platform';
|
import {Platform} from '../../platform/platform';
|
||||||
|
|
||||||
|
|
||||||
@ -167,9 +167,11 @@ export class InputBase {
|
|||||||
*/
|
*/
|
||||||
@ViewChild(NextInput)
|
@ViewChild(NextInput)
|
||||||
private set _nextInput(nextInput: NextInput) {
|
private set _nextInput(nextInput: NextInput) {
|
||||||
nextInput.focused.subscribe(() => {
|
if (nextInput) {
|
||||||
this._form.tabFocus(this);
|
nextInput.focused.subscribe(() => {
|
||||||
});
|
this._form.tabFocus(this);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -333,7 +335,6 @@ export class InputBase {
|
|||||||
*/
|
*/
|
||||||
clearTextInput() {
|
clearTextInput() {
|
||||||
console.log("Should clear input");
|
console.log("Should clear input");
|
||||||
//console.log(this.textInput.value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -518,21 +519,3 @@ function getScrollAssistDuration(distanceToScroll) {
|
|||||||
let duration = distanceToScroll / SCROLL_ASSIST_SPEED;
|
let duration = distanceToScroll / SCROLL_ASSIST_SPEED;
|
||||||
return Math.min(400, Math.max(150, duration));
|
return Math.min(400, Math.max(150, duration));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
@Directive({
|
|
||||||
selector: '[next-input]'
|
|
||||||
})
|
|
||||||
export class NextInput {
|
|
||||||
@Output() focused: EventEmitter<boolean> = new EventEmitter();
|
|
||||||
|
|
||||||
@HostListener('focus')
|
|
||||||
receivedFocus() {
|
|
||||||
this.focused.emit(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -5,11 +5,11 @@ import {Button} from '../button/button';
|
|||||||
import {Config} from '../../config/config';
|
import {Config} from '../../config/config';
|
||||||
import {Content} from '../content/content';
|
import {Content} from '../content/content';
|
||||||
import {Form} from '../../util/form';
|
import {Form} from '../../util/form';
|
||||||
import {InputBase, NextInput} from './input-base';
|
import {InputBase} from './input-base';
|
||||||
import {IonicApp} from '../app/app';
|
import {IonicApp} from '../app/app';
|
||||||
import {Item} from '../item/item';
|
import {Item} from '../item/item';
|
||||||
import {Label} from '../label/label';
|
import {Label} from '../label/label';
|
||||||
import {NativeInput} from './native-input';
|
import {NativeInput, NextInput} from './native-input';
|
||||||
import {NavController} from '../nav/nav-controller';
|
import {NavController} from '../nav/nav-controller';
|
||||||
import {Platform} from '../../platform/platform';
|
import {Platform} from '../../platform/platform';
|
||||||
|
|
||||||
|
@ -142,3 +142,21 @@ function removeClone(focusedInputEle, queryCssClass) {
|
|||||||
clonedInputEle.parentNode.removeChild(clonedInputEle);
|
clonedInputEle.parentNode.removeChild(clonedInputEle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
@Directive({
|
||||||
|
selector: '[next-input]'
|
||||||
|
})
|
||||||
|
export class NextInput {
|
||||||
|
@Output() focused: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
|
@HostListener('focus')
|
||||||
|
receivedFocus() {
|
||||||
|
this.focused.emit(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user