react-native-datepicker icon indicating copy to clipboard operation
react-native-datepicker copied to clipboard

Without default 'date', the input display current date

Open chhornponleu opened this issue 6 years ago • 2 comments

Issue

With below props this.state.date = ''; //also the same when use 'null' value <DatePicker date={this.state.date} .../>

The text display current date instead of leaving the input blank. This made state inconstant with the input text.

Expected Behavior

For consistency between state and input, display it blank.

tested platform: iOS

chhornponleu avatar Dec 04 '18 04:12 chhornponleu

You must put placeholder prop to remove current date value in this case. It worked for me.

vietnd87 avatar Dec 21 '18 05:12 vietnd87

Just pass string with space

<DatePicker
  date={this.state.date}
  placeholder=" "
/>

sbogdaniuk avatar Feb 11 '19 11:02 sbogdaniuk