Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When mask clicked (onPressMask) saves the date value #327

Open
rdewolff opened this issue Mar 19, 2019 · 2 comments
Open

When mask clicked (onPressMask) saves the date value #327

rdewolff opened this issue Mar 19, 2019 · 2 comments

Comments

@rdewolff
Copy link

rdewolff commented Mar 19, 2019

How can we validate the input when the mask is clicked?

I noticed many user wanting to validate the input by simply clicking on the mask and not on the OK button.

What do you think? How can we achieve that?

@rdewolff rdewolff changed the title onPressMask saves the date value When mask clicked (onPressMask) saves the date value Mar 19, 2019
@izhan
Copy link

izhan commented May 24, 2019

+1 to submitting on mask press (I think that's what you mean?)

My workaround for now is using the (undocumented) onPressConfirm:

class MyDatePicker {
  _onPress() {
    const {onPressMask} = this.props;
    this._datePickerRef.onPressConfirm();
    if (onPressMask) {
      onPressMask();
    }
  }

  _onDatePickerRef(ref) {
    this._datePickerRef = ref;
  }

  render() {
    <DatePicker {...this.props} ref={this._onDatePickerRef} onPress={this._onPress} />
  }
}

@drop-george
Copy link

@izhan @rdewolff - this PR adds support for exactly this! #363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants