|
15 | 15 | import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, AfterContentInit, OnDestroy, Optional } |
16 | 16 | from '@angular/core'; |
17 | 17 | import { TextInput, Content, Platform, Slides } from 'ionic-angular'; |
| 18 | +import { Device } from '@ionic-native/device'; |
18 | 19 | import { CoreApp } from '@providers/app'; |
19 | 20 | import { CoreSitesProvider } from '@providers/sites'; |
20 | 21 | import { CoreFilepoolProvider } from '@providers/filepool'; |
@@ -118,7 +119,8 @@ export class CoreEditorRichTextEditorComponent implements AfterContentInit, OnDe |
118 | 119 | protected events: CoreEventsProvider, |
119 | 120 | protected utils: CoreUtilsProvider, |
120 | 121 | protected platform: Platform, |
121 | | - protected editorOffline: CoreEditorOfflineProvider) { |
| 122 | + protected editorOffline: CoreEditorOfflineProvider, |
| 123 | + protected device: Device) { |
122 | 124 | this.contentChanged = new EventEmitter<string>(); |
123 | 125 | this.element = elementRef.nativeElement as HTMLDivElement; |
124 | 126 | this.pageInstance = 'app_' + Date.now(); // Generate a "unique" ID based on timestamp. |
@@ -236,7 +238,7 @@ export class CoreEditorRichTextEditorComponent implements AfterContentInit, OnDe |
236 | 238 | if (CoreApp.instance.isAndroid()) { |
237 | 239 | // In Android we ignore the keyboard height because it is not part of the web view. |
238 | 240 | height = this.domUtils.getContentHeight(this.content) - this.getSurroundingHeight(this.element); |
239 | | - } else if (CoreApp.instance.isIOS() && this.kbHeight > 0 && this.platform.version().major < 12) { |
| 241 | + } else if (CoreApp.instance.isIOS() && this.kbHeight > 0 && Number(this.device.version.split('.')[0]) < 12) { |
240 | 242 | // Keyboard open in iOS 11 or previous. The window height changes when the keyboard is open. |
241 | 243 | height = window.innerHeight - this.getSurroundingHeight(this.element); |
242 | 244 |
|
|
0 commit comments