1

In my Meteor app, to which I've added the bootstrap package, I've got this html in a template:

. . .
<fieldset>
  <legend>A Leg End is either a foot or a Glutius Maximus</legend>
  <label class="labelPerson" for="firstname">First Name</label>
  <input autofocus data-error="First name is required" data-pattern-error="Firstname must contain only letters." id="firstName" pattern="^[A-Za-z\-]+$" required type="text">
  <br/>
  . . .

...but the autofocus is not taking effect - when navigating to this template, the "firstName" text input does not have the focus. Why not? How can I force it there? Do I have to do it after the "onRendered" event for the template?

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 1
    Autofocus is related to HTML5, not Bootstrap. What browser are you using? If it supports the autofocus attribute, it should work fine. If it doesn't you'll need to use a shim. See: http://stackoverflow.com/a/14383846/4665459 – Mark Leiber Oct 14 '15 at 11:30
  • 1
    Works for me in Chrome. Here's my app: https://github.com/markleiber/so_33093279.git – Mark Leiber Oct 14 '15 at 14:00

0 Answers0