using dropzone.js
dropzone.on("addedfile", function(file) {
$('input#photo_title').focus();
});
is there some reason that this script does not work in Safari/iphone? It works just fine on my desktop.
Safari is up to date. i want to put the focus on the input with the mobile keyboard displayed and insert cursor displayed, instead the input is highlighted but must be clicked to bring the keyboard up/insert cursor up.
Set textbox focus in mobile safari
it is not possible to use .focus() to bring up the keyboard in IOS. This is the design and from numerous web sources apparently there is nothing you can do about it.
Related
When typing into a text box with the on-screen keyboard and then tapping on a clickable element while the keyboard is still open
the on-screen keyboard disappears as expected
the tap is ignored, I see in the debugger that the click event handler isn't even reached
tapping on the clickable element again, it now works as designed.
Tapping on other elements on the page with a click event handler while the keyboard is open works fine. One difference is that the unclickable button comes up only while typing, as it is in an autocomplete dropdown, a <ul> element switched visible by removing display: none after the third character is typed.
This happens on Firefox for Android, recent versions. It works in Chrome. Safari on iPad works, but only since the recent 16.x upgrade.
This looks like a weird browser vs platform quirk. Does anyone happen to know a workaround or can even explain some background
EDIT after further experimentation I have a fairly minimal jsfiddle to demonstrate the problem. It seems that Firefox on Android ignores click handlers which are attached to HTML elements created while the on-screen keyboard is open. Wouldn't mind if someone could confirm in a comment that I am not alone with my FF while waiting on an answer from someone in the know.
Dynamic focus using JavaScript is not working properly in iPad iOS 13+(Safari). Click events are also not triggering properly. Are there any major changes in executing JavaScript methods like element focus in the latest iOS for iPad. This is just happening in iPad only and not in iPhone.
Scenario: I need to set focus on an input-box when selecting an item from the auto-populated list. Also, I'm checking this with voice-over in on state. So, I want it to read the value inside the input-box. The same feature is working fine in iPad iOS 12, but showing some weird behavior in iOS 13. Could anyone suggest me a workaround.
One my webpage I have a bootstrap model opened which has a form with two text boxes and few buttons. When I touch text box keyboard opens which is what I would expect but when I press done (on top of open keyboard) to close keyboard, safari on iPhone it scrolls all the way to the top of the page. This is causing model to loose focus and scroll events are being sent to underlying main page. So the question is, is there any way to get keyboard close event so that I can override this behaviour or any other way prevent it from happening. It's only happening on iPhone chrome and iPhone safari. It works fine on android chrome.
So I'm trying to auto select all the text within a textarea on click. Here's my code:
<textarea class="donger" onclick="this.setSelectionRange(0, 9999);" readonly="readonly">Testing</textarea>
http://jsfiddle.net/fvy37tyc/
This works fine in iOS Safari, however it doesn't work in iOS Chrome. If I remove the readonly it works in both browsers but unfortunately then it brings up the keyboard which covers half the screen.
I tried this to remove the keyboard, but unfortunately it disables the auto select:
$('.donger').blur();
Question
So does anybody have any ideas that I could select the text on click on mobile without having the keyboard come up?
I am creating an app in IOS/android with phonegap/cordova framework. I have a set of input types like input boxes, picklists, etc. How can I set the return key to work such that it focuses on the next input box when pressed. I have tried to use javascript in phonegap like:
document.getElementByid('nextElement').focus();
on return/enter; But it does'nt seem to be working ie. focus is lost from the current element but the soft keyboard is vanishing and focus is not coming to the next element. Any idea of where am i missing?
After some googling, it turns out this is not possible on Mobile Safari (although desktop WebKit works).
You can set focus on next element, but soft keyboard won't appear at all.
Here's the PoC of this: http://www.hakoniemi.net/labs/focusOnNext/