MOBILE-2457 messages: Fix bottom padding when keyboard is shown

main
Albert Gasset 2018-07-02 16:08:39 +02:00
parent ef20b3c3dd
commit c2e310e737
1 changed files with 7 additions and 0 deletions

View File

@ -52,6 +52,7 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
protected keepMessageMap = {}; protected keepMessageMap = {};
protected syncObserver: any; protected syncObserver: any;
protected oldContentHeight = 0; protected oldContentHeight = 0;
protected keyboardObserver: any;
userId: number; userId: number;
currentUserId: number; currentUserId: number;
@ -178,6 +179,11 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
this.loaded = true; this.loaded = true;
}); });
}); });
// Recalculate footer position when keyboard is shown or hidden.
this.keyboardObserver = this.eventsProvider.on(CoreEventsProvider.KEYBOARD_CHANGE, (isOn) => {
this.content.resize();
});
} }
/** /**
@ -692,6 +698,7 @@ export class AddonMessagesDiscussionPage implements OnDestroy {
// Unset again, just in case. // Unset again, just in case.
this.unsetPolling(); this.unsetPolling();
this.syncObserver && this.syncObserver.off(); this.syncObserver && this.syncObserver.off();
this.keyboardObserver && this.keyboardObserver.off();
this.viewDestroyed = true; this.viewDestroyed = true;
} }
} }