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

DatePicker not respecting value #22

Open
ghost opened this issue Feb 13, 2020 · 0 comments
Open

DatePicker not respecting value #22

ghost opened this issue Feb 13, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Feb 13, 2020

Describe the bug
DatePicker is not respecting value props. value props is not used.

To Reproduce
Steps to reproduce the behavior:
1.
<DatePicker ... value={this.state.date} />
2. this.state.date not shown in <TextInput/>

Expected behavior
Expected to see value instead of placeholder or defaultDate

Desktop:

  • OS: Windows

Smartphone:

  • Device: Android emulator, guess everywhere
  • OS: Android
  • Version 10

Additional context
Wanted result is reached with little tweak to DatePicker.js is shown lower:
`...
const {focused, defaultDate, error} = this.state;

let {chosenDate} = this.state;
if (!chosenDate) {
  chosenDate = this.props.value ? new Date(this.props.value) : undefined;
}

let inputStyle = [styles.input];

...`

@ghost ghost added the bug Something isn't working label Feb 13, 2020
@ghost ghost assigned samsam-026 Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant