FIX: Apply Visual Viewport composer height calc in iOS only
This commit is contained in:
parent
d0390fba3e
commit
ea4e9dba8e
|
@ -132,12 +132,16 @@ export default Ember.Component.extend(KeyEnterEscape, {
|
|||
$document.on(END_EVENTS, endDrag);
|
||||
});
|
||||
|
||||
if (window.visualViewport !== undefined) {
|
||||
if (this.shouldUseVisualViewportListener()) {
|
||||
this.viewportResize();
|
||||
window.visualViewport.addEventListener("resize", this.viewportResize);
|
||||
}
|
||||
},
|
||||
|
||||
shouldUseVisualViewportListener() {
|
||||
return this.capabilities.isIOS && window.visualViewport !== undefined;
|
||||
},
|
||||
|
||||
viewportResize() {
|
||||
const composerVH = window.visualViewport.height * 0.01;
|
||||
|
||||
|
@ -174,7 +178,7 @@ export default Ember.Component.extend(KeyEnterEscape, {
|
|||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
this.appEvents.off("composer:resize", this, this.resize);
|
||||
if (window.visualViewport !== undefined) {
|
||||
if (this.shouldUseVisualViewportListener()) {
|
||||
window.visualViewport.removeEventListener("resize", this.viewportResize);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue