autofocus

Autofocus doesn't work on Firefox and doesn't work when coming from another page

匆匆过客 提交于 2019-11-28 09:02:48
问题 I'm creating my page using Javascript. It is a login page and I need to use autofocus on username input text. This operation works on IE and Chrome, but doesn't on Mozilla! This is the HTML I have been adding using JS: '<input id="username" class="loginInput" data-bind="value: userName, valueUpdate: \'afterkeydown\'" type="text" name="User" autofocus><!--User Input text end /-->' When i load the page with Mozilla this input is set this way: <input id="username" class="loginInput" type="text"

Autofocus Attribute of HTML5 does not work only in FireFox when <Form><input> are loaded via Ajax. WHY?

浪尽此生 提交于 2019-11-28 07:58:11
问题 Below is the form which i loaded via ajax. When i run the form page directly then autofocus on c_name works in firefox but when loaded with ajax it doesn't! It works fine with opera/safari/chrome though! <form action="client_entry_action.php" method="post" id="client_entry_form" name="client_entry_form"> <fieldset id="client_info_1"> <label for="c_name">Name:</label> <input type="text" name="c_name" required placeholder="Name" autofocus="autofocus" /> <label for="c_phone">Phone Number:</label

Set focus on an input with Ionic 2

主宰稳场 提交于 2019-11-28 06:10:58
SOLVED : import { Component, ViewChild} from '@angular/core'; import { Keyboard } from 'ionic-native'; @Component({ templateUrl: 'build/pages/home/home.html' }) export class HomePage { @ViewChild('input') myInput ; constructor() {} ionViewDidLoad() { setTimeout(() => { Keyboard.show() // for android this.myInput.setFocus(); },150); } } 1) import "ViewChild" import {Component, ViewChild} from '@angular/core'; 2) Create a reference to your input in your html template : <ion-input #focusInput></ion-input> 3) Use @ViewChild to get access to the input component you just referenced previously.

iPhone : camera autofocus observer?

爱⌒轻易说出口 提交于 2019-11-28 05:03:21
I would like to know if it's possible to receive notification about autofocus inside an iPhone application? I.E, does it exist a way to be notified when autofocus starts, ends, if it has succeed or failed... ? If so, what is this notification name ? I find the solution for my case to find when autofocus starts / ends. It's simply dealing with KVO (Key-Value Observing). In my UIViewController: // callback - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if( [keyPath isEqualToString:@"adjustingFocus"] ){ BOOL

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

↘锁芯ラ 提交于 2019-11-28 04:05:17
Prior to iOS8, using the Javascript .focus() method on an input element would appear to have no effect (the virtual keyboard would not display). After the latest iOS 8 release, running the .focus() method seemed to have no effect on page load but once a user touched anywhere on the screen the virtual keyboard would instantly appear and scroll the page to the element in focus. (This is also an issue when I use the HTML attribute "autofocus") This change has caused issues with iOS8 users on my site. When a user attempts to click a button on my page the sudden scroll and keyboard appearance

How to set autofocus only in xaml?

心已入冬 提交于 2019-11-27 22:59:42
问题 Is it possible, to set the autofocus to the textbox in my xaml file? <Window x:Class="WpfApplication1.Views.Test1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="100" Width="210" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" ResizeMode="CanResizeWithGrip"> <TextBox HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility=

Focus (Autofocus) not working in camera (AVFoundation AVCaptureSession)

两盒软妹~` 提交于 2019-11-27 20:17:44
I am using standard AVFoundation classes to capture video and show preview ( http://developer.apple.com/library/ios/#qa/qa1702/_index.html ) Here is my code: - (void)setupCaptureSession { NSError *error = nil; [self setCaptureSession: [[AVCaptureSession alloc] init]]; self.captureSession.sessionPreset = AVCaptureSessionPresetMedium; device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; if ([device isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus] && [device lockForConfiguration:&error]) { [device setFocusMode:AVCaptureFocusModeContinuousAutoFocus]; [device

HTML 5 Autofocus messes up CSS loading

僤鯓⒐⒋嵵緔 提交于 2019-11-27 16:06:11
问题 When I set autofocus="autofocus" on an input element, then in Firefox, when the page loads, it displays for a split second without the CSS applied. (E.g. content not centered, heading rendered in default font etc.) If I remove the autofocus, the page loads fine and displays when it is ready. Is there a way to get the page to load normally while using the autofocus feature in Firefox? 回答1: I have found that by adding some JavaScript in the <head> , the page waits for the style to load before

Setting focus on an HTML input box on page load

99封情书 提交于 2019-11-27 10:56:49
问题 I'm trying to set the default focus on an input box when the page loads (example: google). My page is very simple, yet I can't figure out how to do this. This is what I've got so far: <html> <head> <title>Password Protected Page</title> <script type="text/javascript"> function FocusOnInput() { document.getElementById("PasswordInput").focus(); } </script> <style type="text/css" media="screen"> body, html {height: 100%; padding: 0px; margin: 0px;} #outer {width: 100%; height: 100%; overflow:

Set focus on an input with Ionic 2

…衆ロ難τιáo~ 提交于 2019-11-27 05:40:24
问题 SOLVED : import { Component, ViewChild} from '@angular/core'; import { Keyboard } from 'ionic-native'; @Component({ templateUrl: 'build/pages/home/home.html' }) export class HomePage { @ViewChild('input') myInput ; constructor() {} ionViewDidLoad() { setTimeout(() => { Keyboard.show() // for android this.myInput.setFocus(); },150); } } 1) import "ViewChild" import {Component, ViewChild} from '@angular/core'; 2) Create a reference to your input in your html template : <ion-input #focusInput><