Skip to content

Commit

Permalink
Merge pull request #11 from AyogoHealth/dialog-scrolltop
Browse files Browse the repository at this point in the history
Ensure dialog scrollTop is 0 at opening
  • Loading branch information
dpogue authored Dec 20, 2017
2 parents 23ccbac + 399d3b2 commit fb970cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit fb970cc

Please sign in to comment.