SteveSanderson/knockout — Issue #355: hasfocus won't set focus if element is hidden
Author: mbest
Created: 2012-03-02 03:51:49+00:00
State: open

Demonstration: http://jsfiddle.net/mbest/NTKcU/

Input 1 is in a template that is hidden while it's parsed (visible after if).

Input 2 is in a template that is visible while it's parsed (visible before if).

The button switches between them. The input will be focused for input 2 but not for input 1.

Scenario for input 1 is useful to avoid flashing, especially in Firefox, when the template includes control-flow.