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

Focus request implementation for Android/iOS #2168

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

yamaha252
Copy link
Contributor

Connection with issue(s)

Resolve issue #1974

fhdeodato added a commit to fhdeodato/flutter_inappwebview that referenced this pull request Jun 17, 2024
pichillilorenzo#2168

it is not yet implemented so lets change it until this get the main repo
@fhdeodato
Copy link

This is cool fix, thanks. Hope to get it in the main project soon.

any updates on this @pichillilorenzo ?

@fhdeodato
Copy link

Hey @yamaha252 I did some test using your code and the problem is almost solved for android devices

the focus in the field works, but not able to get the keyboard (tried release and debug versions as well)

for iOS is working great, no issue I could detect...

@h3nr1ke
Copy link

h3nr1ke commented Jul 2, 2024

Just to mention that there is no need to add the requestFocus in the file flutter_inappwebview/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/InAppWebViewInterface.java since it is asking to override in the implementation of

flutter_inappwebview/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebView.java

and the class extends InputAwareWebView that already extends WebView

the request method will be there anyway and since the implementation has no parameters or return value, we just need to call it.

@h3nr1ke
Copy link

h3nr1ke commented Jul 2, 2024

I tried the changes and it helps but didn't solved my issues (withtout the requestFocus implementation was not easy to trigger the focus in the right moment)

but for Android I commented here #1974

For iOS I used the solution presented here Choices-js/Choices#577

with the combination of all, I was able to get the focus working fine from a search input inside a page loaded using in app webview

=)

@danimnh
Copy link

danimnh commented Jul 16, 2024

adding requestFocus by extending the package works. Will be very helpful to have this merged. Thanks!

@arrrrny

This comment was marked as spam.

@pichillilorenzo pichillilorenzo changed the title Focus request implementation Focus request implementation for Android/iOS Nov 4, 2024
@pichillilorenzo pichillilorenzo merged commit 9e55a04 into pichillilorenzo:master Nov 4, 2024
@pichillilorenzo
Copy link
Owner

@all-contributors please add @yamaha252 for code

Copy link
Contributor

@pichillilorenzo

I've put up a pull request to add @yamaha252! 🎉

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

Successfully merging this pull request may close these issues.

6 participants