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

fix(DateRangePicker): various layout issues, footerElement prop #5539

Merged
merged 4 commits into from
Sep 13, 2022

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Sep 13, 2022

Fixes #5537

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

  • Fix DateRangePicker (and transitively, DateRangeInput & DateRangeInput2) to render footerElement correctly

  • Fix a bug in DateRangePicker where it would render both time pickers with showSingleMonthOnly={true} and time pickers enabled

    Screen Shot 2022-09-13 at 4 28 18 PM

Reviewers should focus on:

Making a custom footerElement work in the popover layout required adjusting the DOM structure of DRP somewhat to ensure that the calendars and time pickers get aligned correctly even when there is a very wide footer element that expands the width of the popover and creates extra whitespace. There are some new flexbox container elements. See the screenshot below.

Screenshot

image

Screen Shot 2022-09-13 at 4 29 56 PM

@blueprint-bot
Copy link

fix lint

Previews: documentation | landing | table | demo

.#{$ns}-daterangepicker {
display: flex;
white-space: nowrap;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style has been around since the beginning of this OSS repo, and it's not clear exactly what the benefit is. It's a strange style to inherit for anyone specifying a custom footerElement, so I've chosen to remove it in this PR. I'll keep an eye out for unintended breaks caused by this.


.DayPicker-NavButton--interactionDisabled {
display: none;
}

.#{$ns}-daterangepicker-timepickers {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this block below to reduce CSS specificity

@adidahiya adidahiya changed the title [datetime] fix(DateRangePicker): various layout issues, footerElement prop fix(DateRangePicker): various layout issues, footerElement prop Sep 13, 2022
@adidahiya adidahiya merged commit df7c038 into develop Sep 13, 2022
@adidahiya adidahiya deleted the fz/date-range-input-footer-element branch September 13, 2022 21:00
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

Successfully merging this pull request may close these issues.

[DateRangeInput2]: footerElement prop does not render
3 participants