Skip to content

Commit

Permalink
fix(datepicker): allow empty placeholder (uber#4437)
Browse files Browse the repository at this point in the history
Co-authored-by: Will Ernest <[email protected]>
  • Loading branch information
Deliaz and williamernest authored Aug 4, 2021
1 parent 12fdf36 commit 669eb8e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,11 @@ export default class Datepicker<T = Date> extends React.Component<
);

const placeholder =
this.props.placeholder ||
(this.props.range ? 'YYYY/MM/DD – YYYY/MM/DD' : 'YYYY/MM/DD');
this.props.placeholder || this.props.placeholder === ''
? this.props.placeholder
: this.props.range
? 'YYYY/MM/DD – YYYY/MM/DD'
: 'YYYY/MM/DD';

return (
<LocaleContext.Consumer>
Expand Down

0 comments on commit 669eb8e

Please sign in to comment.