Skip to content

Commit

Permalink
Merge pull request #14427 from Expensify/marco-fixResetDatePicker
Browse files Browse the repository at this point in the history
Set initialValue right after date picker is shown on iOS
  • Loading branch information
neil-marcellini authored Jan 20, 2023
2 parents f0846a3 + d312efe commit 17edc82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/DatePicker/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class DatePicker extends React.Component {
* @param {Event} event
*/
showPicker(event) {
this.initialValue = this.state.selectedDate;

// Opens the popover only after the keyboard is hidden to avoid a "blinking" effect where the keyboard was on iOS
// See https://github.com/Expensify/App/issues/14084 for more context
if (!this.props.isKeyboardShown) {
Expand All @@ -50,7 +52,6 @@ class DatePicker extends React.Component {
listener.remove();
});
Keyboard.dismiss();
this.initialValue = this.state.selectedDate;
event.preventDefault();
}

Expand Down

0 comments on commit 17edc82

Please sign in to comment.