Skip to content

Instantly share code, notes, and snippets.

@Youness-e
Youness-e / keyboard-attach.directive.ts
Last active December 24, 2019 10:02 — forked from Manduro/keyboard-attach.directive.ts
Ionic Keyboard Attach Directive
import { Directive, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { Keyboard } from '@ionic-native/keyboard/ngx';
import { Platform } from '@ionic/angular';
import { fromEvent, Subscription } from 'rxjs';
/**
* @source https://gist.github.com/Youness-e/5c4f49f3aaa4ee90f45b75818764114d
* @description
* The `keyboardAttach` directive will cause an element to float above the
* keyboard when the keyboard shows. Currently only supports the `ion-footer` element.