Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

IOS setFocus on input make screen jump #175

Open
ionitron-bot bot opened this issue Nov 28, 2018 · 2 comments
Open

IOS setFocus on input make screen jump #175

ionitron-bot bot opened this issue Nov 28, 2018 · 2 comments
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 28, 2018

Original issue by @llorenspujol on 2017-01-31T16:05:40Z

Ionic version: (check one with "x")
[ ] 1.x
[x ] 2.x

I'm submitting a ... (check one with "x")
[ x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
I have multiple inputs in a page, and I focus them manually every time using the setFocus() method. The problem is that when i do so, the page makes the correct scroll but when this scroll is finished it return to de no scroll position, is like something is cancelling the scroll. I have read a lot of issues of IOS keyboard and i still couldn't find exactly what the problem is.

In this gif is shown the current behaviour.
https://i.gyazo.com/53f5d32e166e3ef9929402bb6e9dc822.gif

Expected behavior:

Of course the current behaivour would be that when focusing the scroll stays stable.

@prescindivel
Copy link

Solution?

@hedshafran
Copy link

hedshafran commented Aug 20, 2019

In my case, wrapping the element.focus() with setTimeout solved the issue:

setTimeout(() => {
    element.focus();
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants