Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

add autofocus attribute support #47

Closed
gcanti opened this issue Jan 8, 2015 · 9 comments
Closed

add autofocus attribute support #47

gcanti opened this issue Jan 8, 2015 · 9 comments

Comments

@gcanti
Copy link
Owner

gcanti commented Jan 8, 2015

No description provided.

@srconklin
Copy link

I can seem to get autoFocus to work...
is this not they way to specify it?

var LoginForm = t.struct({
email: aValidEmail
});

var Form = t.form.create(LoginForm, {
email : {
autoFocus: true

            }
        }

@gcanti
Copy link
Owner Author

gcanti commented Jan 18, 2015

It's correct, but the autoFocus feature is only on master. I'll release the v0.3 in a couple of days
when the tuple support will be complete (or you can link the master branch in the meanwhile).

@srconklin
Copy link

ah! i was just noticing that installing from NPM did not have those changes.. will wait for v0.3. thanks.

@gcanti
Copy link
Owner Author

gcanti commented Jan 21, 2015

v0.3.0 released. I decided to release with tuples as an experimental feature to speed up the release cycle. Let me know if it's everything ok with autoFocus.

@srconklin
Copy link

Thanks. I will give this a try later today...

@srconklin
Copy link

it is not working for me... I don't see my form element having the focus on initial load
I wonder if it related to this which i have also experienced.
#51

@chasm
Copy link

chasm commented Jun 3, 2015

Autofocus still does not seem to work. Am I missing something or is this still broken?

@gcanti
Copy link
Owner Author

gcanti commented Jun 3, 2015

Hi,
starting from v0.5 autoFocus is moved in the attrs option:

var Person = t.struct({
  name: t.Str,
  surname: t.Str
});

var options = {
  fields: {
    name: {
      attrs: {
        autoFocus: true
      }
    }
  }
};

@chasm
Copy link

chasm commented Jun 3, 2015

Brilliant! Works perfectly, and a nice improvement. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants