Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listen to actions performed #571

Open
irohitb opened this issue Jun 17, 2019 · 0 comments
Open

Listen to actions performed #571

irohitb opened this issue Jun 17, 2019 · 0 comments

Comments

@irohitb
Copy link

irohitb commented Jun 17, 2019

Version

Tell us which versions you are using:

  • tcomb-form-native v0.6.20?
  • react-native v0.?.?

Question

How can we add an event listener to see listen to events such as the appearance of a date picker?

In the below GIF, I want my keyboard to disappear whenever date time picker is visible.

I have keyboard listener function in my code but for this, I think I would need a function which listens when date time picker is shown

Here is how we are using tcomb-form-native

const Form = t.form.Form

const Gender = t.enums({
	M: 'Male',
	F: 'Female'
})

const options = {
	fields: {
		birthDate: {
			mode: 'date' // display the Date field as a DatePickerAndroid
		}
	}
}

const User = t.struct({
	email: t.String,
	username: t.String,
	fullName: t.String,
	gender: Gender,
	birthDate: t.Date,
	terms: t.Boolean
})

and then in my jsx

	<Form 
	  type={User} 
	  options={options} 
	 onChange={this.onChange} />

Also, If I can listen to the events, I can remove Tell us about yourself from the UI whenever picker is visible.

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

No branches or pull requests

1 participant