ionic-framework: Cursor does not follow input when scrolling with $ionicScrollDelegate on iOS

This is the same problem as described in #26 and #1063. It seems that it was fixed for scrolling by the user, but if the scroll is done programatically the problem still occurs.

here is a snippet from a directive:

var scroller = $ionicScrollDelegate.$getByHandle('my-handle'),
      setTop = function(){
        var top = element[0].getBoundingClientRect().top;
        if ( top > 62){ scroller.scrollBy(0, top - 62, true); }
      };

When setTop is called, the scroll happens, but cursor stays in the original position (no longer over the input).

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

Looks like it’s a bug from webkit in Safari mobile: https://bugs.webkit.org/show_bug.cgi?id=138201#c5

(http://openradar.appspot.com/18819624)

It will probably never be fixed (lasting since iOS 7). The only workaround (given by the community) seems to consist in hiding the cursor by triggering blur(), and then focusing again (focus()) when scroll is done…

I am facing this same issu in android. Any solutions?