You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Autofocus on an <input> doesn't work if the user hasn't "interact" with the webview before (touch anywhere on the screen after the splashscreen is gone). The input is not focused, neither is the keyboard shown.
BUT if we tap somewhere on the screen then triggering focus (eg with a settimeout), it works.
Android issue only.
Expected Behavior
Setting focus to an input to work even at startup.
Sample Code or Sample Application Repo
I have used npx @capacitor/cli create to create a minimalist project.
1- Launch the app
2- Focus on an input document.getElementById("mytext").focus(); without tapping / clicking anywhere before.
I have added a timeout, so I have time to "interact" with the app after the splash screen is hidden. When I do so, the input is focused with no issue.
When I say "interact", I mean to simply touch/click anywhere on the webview, like below the input on the rest of the page (in a blank area).
Other Technical Details
npm --version output: 6.13.7
node --version output: v13.8.0
Other Information
My note taking app (AndroidApple) relies heavily on UX and showing as soon as possible a focused input with the keyboard up and running is major concern. Unfortunately it is not working anymore since upgrading to capacitor from cordova.
The text was updated successfully, but these errors were encountered:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
Capacitor Version
npx cap doctor
output:Affected Platform(s)
Current Behavior
Autofocus on an
<input>
doesn't work if the user hasn't "interact" with the webview before (touch anywhere on the screen after the splashscreen is gone). The input is not focused, neither is the keyboard shown.BUT if we tap somewhere on the screen then triggering focus (eg with a settimeout), it works.
Android issue only.
Expected Behavior
Setting focus to an input to work even at startup.
Sample Code or Sample Application Repo
I have used
npx @capacitor/cli create
to create a minimalist project.Here is the body of
index.html
Reproduction Steps
1- Launch the app
2- Focus on an input
document.getElementById("mytext").focus();
without tapping / clicking anywhere before.I have added a timeout, so I have time to "interact" with the app after the splash screen is hidden. When I do so, the input is focused with no issue.
When I say "interact", I mean to simply touch/click anywhere on the webview, like below the input on the rest of the page (in a blank area).
Other Technical Details
npm --version
output: 6.13.7node --version
output: v13.8.0Other Information
My note taking app (Android Apple) relies heavily on UX and showing as soon as possible a focused input with the keyboard up and running is major concern. Unfortunately it is not working anymore since upgrading to capacitor from cordova.
The text was updated successfully, but these errors were encountered: