refactor(keyboard): move to utils

This commit is contained in:
Manu Mtz.-Almeida
2018-03-19 20:10:37 +01:00
parent 4d8a99f03b
commit c85f7483c9
23 changed files with 120 additions and 299 deletions

View File

@ -33,6 +33,7 @@ export class Picker implements OverlayInterface {
@Prop({ connect: 'ion-animation-controller' }) animationCtrl: HTMLIonAnimationControllerElement;
@Prop({ context: 'config' }) config: Config;
@Prop() overlayId: number;
@Prop() keyboardClose = true;
/**
* Animation to use when the picker is presented.
@ -145,10 +146,6 @@ export class Picker implements OverlayInterface {
@Method()
present(): Promise<void> {
return present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined).then(() => {
// blur the currently active element
const activeElement: any = document.activeElement;
activeElement && activeElement.blur && activeElement.blur();
// If there is a duration, dismiss after that amount of time
if (this.duration > 10) {
this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);

View File

@ -52,6 +52,11 @@ If true, the picker will be dismissed when the backdrop is clicked. Defaults to
Animation to use when the picker is presented.
#### keyboardClose
boolean
#### leaveAnimation
@ -123,6 +128,11 @@ If true, the picker will be dismissed when the backdrop is clicked. Defaults to
Animation to use when the picker is presented.
#### keyboard-close
boolean
#### leave-animation