Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'autofocus: true' doesn't open keyboard #184

Open
avdhootu27 opened this issue Apr 27, 2024 · 3 comments
Open

'autofocus: true' doesn't open keyboard #184

avdhootu27 opened this issue Apr 27, 2024 · 3 comments
Assignees

Comments

@avdhootu27
Copy link

Describe the bug
If I set autofocus=true, the focus goes to pinput but the keyboard doesn't open. I need to tap on the pinput widget to open the keyboard. The keyboard should also open.

To Reproduce
Steps to reproduce the behavior:

  1. Set autofocus:true

Screenshots

VID_20240427_192136.mp4

Pinput version: 3.0.1

Result of: flutter doctor --verbose

[✓] Flutter (Channel stable, 3.19.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-US) • Flutter version 3.19.0 on channel stable at /Users/avdhoot/Development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision bae5e49bc2 (2 months ago), 2024-02-13 17:46:18 -0800 • Engine revision 04817c99c9 • Dart version 3.3.0 • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/avdhoot/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.88.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
• iPhone 15 Pro Max (mobile) • E717C647-386F-4E05-82D9-7B956C76D7EC • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.91

[✓] Network resources
• All expected network resources are available.

• No issues found!

Smartphone (please complete the following information):

  • Device: Redmi Note 13 Pro
  • OS: Android 14
@jblankenship5
Copy link

The keyboard also does not appear for me on mobile browsers on iOS.

@Tkko
Copy link
Owner

Tkko commented Jul 10, 2024

Hi @jblankenship5, can you check if the autofocus works if you replace Pinput with:

    return TextField(
      autofocus: true,
    );

@jblankenship5
Copy link

jblankenship5 commented Jul 10, 2024

No it does not @Tkko, after some research I've come to realize that autofocus doesn't work at all on mobile browsers on iOS. I guess the OS requires the user to tap on the screen or give some kind of input. For this reason I have turned auto focus off for iOS browsers, and that includes all the other form widgets in my app.

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

No branches or pull requests

3 participants