iOS keyboard without Prev, Next, Done button for HTML input field? - javascript

I am making a mobile HTML page that has an input field. When I tap the inside of the input field, the iOS 7 keyboard appears. But the keyboard has a top ribbon that contains "<", ">", and "Done" buttons, as this
How to get rid of this top ribbon on keyboard? I want to keyboard style same as for safari address bar input and the iOS7 "Messages" app. Thanks!

its not possible due to the way iOS is designed,maybe in the future but for now we are stuck with this keyboard

As of iOS 9.3 this is not possible. (Unlike android) iOS is not open source so it's hard to prove but It's likely intentional because there is no other safe way to exit the keyboard. (Unlike android which has a back/close-keyboard button on swipe up or physically depending on the device).
The following is a list of border cases that one might expect to hide the done bar if it were possible to do so;
<span contenteditable="true"
<input tabindex="-1"
<input type="search"
only one input tag on the page
no form tag

Related

disable the native keyboard with javascript when clicking on input field

I need to disable the native keyboard on ios devices when clicking on an input field, I tried to use the "read-only" attribute, however it disables the caret as well and the cursor is not visible anymore. is there any way to fix this issue with javascript?
I also tried using this.blur() to stop loading the keyboard. but it shows the keyboard for a moment and then disappears.

How to avoid an input field becoming hidden when a keyboard is up on Android Chrome browser?

Is there a way to automatically scroll down on a webpage, when a certain input field becomes hidden due to Android keyboard on Chrome for Android? I know how to scroll a webpage using JavaScript, but has someone tried to do it for this specific purpose?

How can I focus on a text input without showing on-screen keyboard

I'm making a chat service, and I want to support mobile devices well.
On a screenshot below, there is an input field. It allows typing text, and to avoid issues like "if the text field is unfocused typing does nothing" it automatically gets focused when clicking outside of it - this does improve the experience on desktop computers. However, on devices with software keyboard, this causes on-screen keyboard to appear on mobile devices which is distracting.
Considering clicking anywhere focuses the text input, is it somehow possible to make on-screen keyboard only appear when the text field is pressed? Or alternatively, somehow detect devices with software keyboard enabled and disable this feature for them. Preferably without explicitly trying to detect mobile devices, touch screen or whatever as there exist touch screen devices with hardware keyboards.
This issue I was able to reproduce in Google Chrome and Opera Mobile on Android, and apparently it happens on iPhones, although I have no device to test it on.
Here is a rather simple example of an issue. If you touch the pink rectangle, it will cause touch keyboard to appear, which I don't want.
<input type=text id=f>
<div style="background: pink; height: 200px; width: 200px" onclick="f.focus()">
The short answer is that this is a built in function and you can't stop it, but there are a couple of options to consider.
1) use the onFocus event to immediately trigger the blur event to hide the keyboard again.
2) set readonly="true" on the element, later remove it and trigger the focus event.
3) create a fake input element with div's and css, when you want to trigger the keyboard focus on a hidden input field and copy out the value of the input on the keyup event as the user types.
Hope these suggestions were helpful to you.
If I got this right, you may also consider to change the logic of focusing the textfield when there is a click "anywhere". On touch-devices the touch events get dispatched first and you can cancel the click-handling (look for preventDefault(), return false; or stopPropagation() which should be called in you touch event handler).
You will need another event listener which handles the touch events outside the textfield, e.g. "touchstart".
If you want to keep the ui effect of a focused textfield, just add a css class "focused" to the textfield by script instead of using textfield:focused{} for your styles.

On Safari Mobile, auto-select all the text of a read-only input on focus

I'm trying to use an input text box as a URL sharing widget. Fairly standard: when you click on the textbox, all of the text inside is automatically highlighted to make it easy to copy and paste. It's set as read-only='read-only' to prevent the user from changing the URL accidentally, and the click event is set to this.focus();this.select();. This works on the desktop.
The problem arises with Safari Mobile (I'm using iOS 7.0.6). From what I can tell, the read-only prevents using the standard setSelectionRange(0,9999);. But if I turn off read-only and just use javascript to prevent editing, the iOS keyboard shows once the text input has focus.
tl;dr On Safari Mobile I'd like to have the uneditable textbox be entirely selected on focus but without showing the keyboard (ideally it would show the copy/paste menu too, but I think that's a stretch). Is this possible?
JSFiddle shamelessly forked from this answer:
JSFiddle showing input with read-only set (Doesn't work on Safari Mobile iOS 7.0.6)

Javascript / jQuery Windows 8 On-Screen Keyboard

I'm trying to build an application where if the user activates a page, a focus event will occur and focus into a text field. I was half-heartedly expecting that when I called .focus() on in the input box, Windows 8 would pop-up the on-screen keyboard. This in not the case.
Does anyone know of a way to get the Windows 8 on-screen keyboard to come up when the text field is focused via javascript.
If the user "taps" into the textfield, the focus event does fire and the keyboard comes up.
I've tried binding to touchstart, 'touchend, click and focus, but all of these do not seem to activate the on-screen keyboard.
This application will run strictly on Windows 8, so there is no need to make it so that other platforms that do not have built-in on-screen keyboards work properly.
You can't. Only user actions can open the on-screen keyboard. This is by design. See here.

Categories