Skip to content

Commit

Permalink
DatePicker: jsdocs parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
kidroca committed Sep 28, 2021
1 parent 9a3e83b commit 9db7aa9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/DatePicker/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ class DatePicker extends React.Component {
this.raiseDateChange = this.raiseDateChange.bind(this);
}

/**
* @param {Event} event
*/
showPicker(event) {
this.setState({isPickerVisible: true});
event.preventDefault();
}

/**
* @param {Event} event
* @param {Date} selectedDate
*/
raiseDateChange(event, selectedDate) {
if (event.type === 'set') {
this.props.onChange(selectedDate);
Expand Down
7 changes: 7 additions & 0 deletions src/components/DatePicker/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class Datepicker extends React.Component {
this.updateLocalDate = this.updateLocalDate.bind(this);
}

/**
* @param {Event} event
*/
showPicker(event) {
this.initialValue = this.state.selectedDate;
this.setState({isPickerVisible: true});
Expand All @@ -52,6 +55,10 @@ class Datepicker extends React.Component {
this.props.onChange(this.state.selectedDate);
}

/**
* @param {Event} event
* @param {Date} selectedDate
*/
updateLocalDate(event, selectedDate) {
this.setState({selectedDate});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/DatePicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Datepicker extends React.Component {
/**
* Pops the datepicker up when we focus this field. This only works on mWeb
* On mWeb the user needs to tap on the field again in order to bring the datepicker. But our current styles
* don't make this very obvious. To avoid confusion we open the datepicker when the user focus the field
* don't make this very obvious. To avoid confusion we open the datepicker when the user focuses the field
*/
showDatepicker() {
if (this.inputRef) {
Expand Down

0 comments on commit 9db7aa9

Please sign in to comment.