99x / 99x/first-born

DatePicker not respecting value

Open
#22 0 comments 0 reactions 1 assignee Claimed by @samsam-026 View on GitHub
bug
Dominant language
JavaScript
Stars
267
Forks
27
PR merge metrics
No merged PRs in 30d

Description

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

**To Reproduce**
Steps to reproduce the behavior:
1.
``
2. `this.state.date` not shown in ``

**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];
...`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.