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

DateRangeInput: Controlled component doesn't accept value=[undefined, undefined] #1254

Closed
alshain opened this issue Jun 20, 2017 · 0 comments

Comments

@alshain
Copy link

alshain commented Jun 20, 2017

Bug report

  • Package version(s): core: 1.20.0, datetime 1.17.0
  • Browser and OS versions: Chrome, Win 10

Steps to reproduce

render() {
        // As per documentation, unset date in uncontrolled mode be [null, null]
        // http://blueprintjs.com/docs/#datetime/daterangeinput
        // tslint:disable-next-line:no-any
        const value: [Date | undefined, Date | undefined] = [
            this.props.from.value ? this.props.from.value : undefined,
            this.props.to.value ? this.props.to.value : undefined
        ];
        return (
            <BlueprintDate.DateRangeInput
                onChange={this.onChange}
                value={value}
            />
        );

Actual behavior

The type definition requires value to be of the type [Date | undefined, Date | undefined]. Passing [undefined, undefined], however, results in the following:

image

Expected behavior

I expect this to produce the same behavior as [null, null], which is, as of now, disallowed by the type signature.

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

No branches or pull requests

3 participants