Commit acd47f5c authored by Dmitry Rozhkov's avatar Dmitry Rozhkov

[embedlite] Check for existance of vkbOpenCompositionMetrics before using it

parent 216f6d71
......@@ -333,7 +333,7 @@ EmbedHelper.prototype = {
// Facebook generates two Viewport:Change's after an input field is tapped. And only
// the second one is valid because Facebook's JS makes the page longer after the tap.
let maxViewportChanges = 2;
if (this.vkbOpenCompositionMetrics.imOpen &&
if (this.vkbOpenCompositionMetrics && this.vkbOpenCompositionMetrics.imOpen &&
(this.viewportChangesSinceVkbUpdate <= maxViewportChanges) &&
Math.abs((this._viewportData.cssCompositedRect.height * this.vkbOpenCompositionMetrics.resolution) - this.vkbOpenCompositionMetrics.compositionHeight) < epsilon) {
this.scrollToFocusedInput();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment