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
ability to focus webview #278
Comments
I might look for something similar... on iPhone I need to tap the WebView first to gain focus and only the second tap is actually triggering a tap in the WebView. Though on iPad the very first tap is handled by the WebView. |
This would be such an enormous deal for usability, I can't overstate it. Webviews are often used to wrap editors and if you can't focus the Webview for the user things just feel terrible. |
We would love someone to take the initiative on this and make a PR! ❤️ |
We need this feature too. |
There's a pull request in progress now for this, #540. Help testing it would be amazing @Wilson-Lim, @slapbox , @jaulz, @alidcastano ! Thanks to @ericlewis |
Unfortunately I can't test this (using Expo still at the moment) but thanks so much to @ericlewis for the PR to @jamonholmgren for keeping on top of everything! |
@ericlewis @jamonholmgren thanks! I'm not an expert in Objective C so please excuse my question but would this piece of code also be reusable for a |
Do you mean UIWebView? Technically, you should only need to expose this already existing prop. If you mean androids webview, then no it’s not reusable there.
Sent via Superhuman iOS ( https://sprh.mn/?vip=ericlewis777@gmail.com )
…On Mon, Apr 29 2019 at 2:53 AM, < ***@***.*** > wrote:
@ericlewis ( https://github.com/ericlewis ) @jamonholmgren (
https://github.com/jamonholmgren ) thanks! I'm not an expert in Objective C
so please excuse my question but would this piece of code also be reusable
for a focus method on the WebView?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
#278 (comment)
) , or mute the thread (
https://github.com/notifications/unsubscribe-auth/AAFEVR5D4RM42GABUJHN4QDPS2LQBANCNFSM4GSPC7HA
).
|
@jaulz or do you mean a method you can call to “focus” the webview? There is no method to call in this case (I’m not sure how that would work either) what this allows is for the javascript in the webview to call focus on a text element and the keyboard will display without user interaction. This isn’t enabled by default on iOS. |
@ericlewis - I can programatically focus within a Webview as is, but that's not enough to get the keyboard to appear unless the user has already focused the Webview itself. Both the Webview AND a text editable element on the page must be focused for the keyboard to show. Once a Webview has been focused once, focusing an inner element seems to be enough to show the keyboard. All of that is the case for Android at least. |
Gotcha. Yeah, on iOS this allows the User to skip the step of needing to focus (tap) the WebView. I will see if I can get this to work on droid too.
Sent via Superhuman ( https://sprh.mn/?vip=ericlewis777@gmail.com )
…On Mon, Apr 29, 2019 at 12:59 PM, Slapbox < ***@***.*** > wrote:
@ ericlewis ( https://github.com/ericlewis ) - I can programatically focus
within a Webview as is, but that's not enough to get the keyboard to appear
unless the user has already focused the Webview itself. Both the Webview
AND a text editable element on the page must be focused for the keyboard
to show. Once a Webview has been focused once, focusing an inner element
seems to be enough to show the keyboard.
All of that is the case for Android at least.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
#278 (comment)
) , or mute the thread (
https://github.com/notifications/unsubscribe-auth/AAFEVR4KYIAJJZVOFD265V3PS4SNRANCNFSM4GSPC7HA
).
|
I assume #540 solves your problem, @alidcastano ? If so, we can close this. |
@jamonholmgren #540 doesn't yet resolve the problem in my view. |
i, unfortunately, haven't had a chance to check but will go ahead and close this issue - thanks @amonholmgren (and @ericlewis!) |
Just asking here in case a miracle is possible. |
You could inject your own JavaScript that looks for the ID or class of the desired input then have it focus once DOM is ready. Use the injectedJavascript prop.
Sent via Superhuman iOS ( https://sprh.mn/?vip=ericlewis777@gmail.com )
…On Sun, May 26 2019 at 4:21 PM, < ***@***.*** > wrote:
Just asking here in case a miracle is possible.
Is there any way to automatically focus on an input field inside iframe?
I don't control the iframe as it's the bank credit card iframe.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
#278
) , or mute the thread (
https://github.com/notifications/unsubscribe-auth/AAFEVR6VY3VOZS546RUCLYTPXLWOPANCNFSM4GSPC7HA
).
|
Is there any way this could prop could be implemented on android? If not, how can I programmatically show they keyboard when an input has focus in the webview? I tried |
There's no way to programmatically focus the webview on Android. I think this feature is desperately needed. |
Focus still not working in android |
I advise everybody to move this discussion over to #1172 Indeed, focusing is still not implemented on Android - so this really shouldn't have been closed - but it is. |
I'm trying to embed an editor inside a webview, but clicking on the webview itself does not seem to focus it (so that the keyboard can open and user can edit). Is it possible to focus the webview?
note: editing inside webview works on the simulator (where I can type via desktop keyboard).
The text was updated successfully, but these errors were encountered: