This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Support HTML5 autofocus attribute #10833
Open
Description
http://caniuse.com/#feat=autofocus tells the browser to focus an element on page load. It would be great if Angular had support for this built-in, so that it also works on browsers that don't support it and when creating elements dynamically, like in forms.
As an example, here's a directive that does this: https://gist.github.com/mlynch/dd407b93ed288d499778
Perhaps this can be used as-is, or it might need adapting for the case where many elements with the autofocus
attribute get created at once (per the spec only one such element should exist per doc but hey).