React-dates: Unable to Position/Offset the DatePicker (and fang)

Created on 6 Apr 2018  路  2Comments  路  Source: airbnb/react-dates

The style property is being directly set for the datepicker/fang. It is a problem because all my other 'popups' use a different offset.

How can I more closely position of the datepicker to the Input field?

screen shot 2018-04-06 at 09 24 52

Hint: I'm not looking for an answer with CSS directive !important

Most helpful comment

Update:

I discovered an undocumented property: verticalSpacing which can _help_ mitigate the problem. However it looks like the inputHeight calculation is a little bit off

All 2 comments

Update:

I discovered an undocumented property: verticalSpacing which can _help_ mitigate the problem. However it looks like the inputHeight calculation is a little bit off

@sscholle I'm running into this same issue, and even i figured out looking at the code in DateRangePicker.jsx about the verticalSpacing property. But when i pass the following prop value, for some strange reason, this prop value is being seen as 0 inside the render function of DateRangePicker.

<DateRangePicker
          displayFormat="DD/MM/YYYY"
          startDate={this.props.startDate} // momentPropTypes.momentObj or null,
          startDateId="startDate" // PropTypes.string.isRequired,
          endDate={this.props.endDate} // momentPropTypes.momentObj or null,
          endDateId="endDate" // PropTypes.string.isRequired,
          onDatesChange={this.props.dateRangeUpdated}
          focusedInput={this.props.focusedInput} // PropTypes.oneOf([START_DATE, END_DATE]) or null,
          onFocusChange={this.props.onFocusChange} // PropTypes.func.isRequired,
          hideKeyboardShortcutsPanel={true}
          isOutsideRange={this.isOutsideRange.bind(this)}
          verticalSpacing={10}
        />

Did you get your issue resolved using verticalSpacing ? If so, can you show how you are passing the prop value. Thanks.

Was this page helpful?
0 / 5 - 0 ratings