How to avoid automatic focus on first input field when popping a HTML form as a JQuery dialog?

What I did was I created an extra input and made it invisible (style=”display:none”) then gave it the property autofocus=”true” put this at the end of your dialog content so it wont mess with anything. it should look like this: <div><!–dialog div–> <button></button> <button></button> <input type=”hidden” autofocus=”true” /> </div>

Set focus on an input with Ionic 2

You don’t need to import the ‘Input’ from ‘angular/core’. Simply: import {Component,ViewChild} from ‘@angular/core’; import {NavController, TextInput } from ‘ionic-angular’; @Component({ templateUrl: ‘build/pages/home/home.html’ }) export class HomePage { @ViewChild(‘input’) myInput: TextInput; constructor(private navCtrl: NavController) { } ionViewDidLoad() { setTimeout(() => { this.myInput.setFocus(); },150); } } And answering comment to Ciprian Mocanu: It does not work … Read more

in iOS8 using .focus() will show virtual keyboard and scroll page after touch

It looks like you’re definitely hitting an iOS 8 bug. In iOS7, Safari would (apparently) ignore or keep unfocused elements that had focus set prior to page load. This includes both <input autofocus> and input.focus() that occur up to some point, possibly page load (I tested just with an inline script). In iOS 8, Safari … Read more

Disable auto focus on edit text

Add the android:focusable=”true” and android:focusableInTouchMode=”true” elements in the parent layout of EditText as follow; <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/linearLayout7″ android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:focusable=”true” android:focusableInTouchMode=”true”> I think, it should help you. See also;     Android Developers official guide on handling touch and input

is it autofocus=”autofocus” or autofocus?

In HTML, you use boolean attributes with or without values as you like. A boolean, for W3C, like autofocus can be written like that autofocus or autofocus=”autofocus” or also autofocus=””. If you don’t want autofocus just don’t write it. I think you are confused because XHTML requires values for all attributes: attributes=”values”. Here is some … Read more

tech