From 399d3b2af15fb84b76d885937d3e11e6e542a81c Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Wed, 20 Dec 2017 14:21:07 -0800 Subject: [PATCH] Ensure dialog scrollTop is 0 at opening --- dialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dialog.js b/dialog.js index 3988b45..2d2cdcc 100644 --- a/dialog.js +++ b/dialog.js @@ -100,6 +100,9 @@ angular.module('ayDialog', []) // Ewww, because "autofocus" will cause trouble for iOS :( var control = el.querySelector('[autofocus]:not([disabled])'); + // Ensure we start scrolled to the top of the dialog, before focusing + el.scrollTop = 0; + if (control && !skipauto) { if (immediate) { control.focus();