fix(input): change next input imports

This commit is contained in:
Adam Bradley
2016-01-26 14:34:59 -06:00
parent aea2217d73
commit 70a9eb3e38
3 changed files with 26 additions and 25 deletions

View File

@ -9,7 +9,7 @@ import {IonicApp} from '../app/app';
import {Label} from '../label/label';
import {pointerCoord, hasPointerMoved, closest} from '../../util/dom';
import {NavController} from '../nav/nav-controller';
import {NativeInput} from './native-input';
import {NativeInput, NextInput} from './native-input';
import {Platform} from '../../platform/platform';
@ -167,9 +167,11 @@ export class InputBase {
*/
@ViewChild(NextInput)
private set _nextInput(nextInput: NextInput) {
nextInput.focused.subscribe(() => {
this._form.tabFocus(this);
});
if (nextInput) {
nextInput.focused.subscribe(() => {
this._form.tabFocus(this);
});
}
}
/**
@ -333,7 +335,6 @@ export class InputBase {
*/
clearTextInput() {
console.log("Should clear input");
//console.log(this.textInput.value);
}
/**
@ -518,21 +519,3 @@ function getScrollAssistDuration(distanceToScroll) {
let duration = distanceToScroll / SCROLL_ASSIST_SPEED;
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);
}
}

View File

@ -5,11 +5,11 @@ import {Button} from '../button/button';
import {Config} from '../../config/config';
import {Content} from '../content/content';
import {Form} from '../../util/form';
import {InputBase, NextInput} from './input-base';
import {InputBase} from './input-base';
import {IonicApp} from '../app/app';
import {Item} from '../item/item';
import {Label} from '../label/label';
import {NativeInput} from './native-input';
import {NativeInput, NextInput} from './native-input';
import {NavController} from '../nav/nav-controller';
import {Platform} from '../../platform/platform';

View File

@ -142,3 +142,21 @@ function removeClone(focusedInputEle, queryCssClass) {
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);
}
}