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

Add popoverPlacement prop in EuiDatePicker #3359

Conversation

elizabetdev
Copy link
Contributor

@elizabetdev elizabetdev commented Apr 20, 2020

Summary

Closes #3356.
Closes #2889.
Closes #2752.

The popperPlacement prop is part of the ReactDatePicker and I'm just exposing it in our documentation.

I noticed that the openToDate prop is repeated in both date_picker.tsx file and react-datepicker.d.ts and I followed this example in order to expose the popperPlacement prop in our documentation.

I also changed the Date picker range demo by adding popperPlacement="bottom-end". I think the design looks better this way.

datepicker_popper@2x

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • [ ] Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation examples
  • Added or updated jest tests
  • [ ] Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

src/components/date_picker/date_picker.tsx Outdated Show resolved Hide resolved
src/components/date_picker/date_picker.tsx Outdated Show resolved Hide resolved
src-docs/src/views/date_picker/range.js Outdated Show resolved Hide resolved
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/

@elizabetdev elizabetdev requested a review from cchaos April 21, 2020 14:44
CHANGELOG.md Outdated Show resolved Hide resolved
@@ -39,6 +39,8 @@ export const euiDatePickerDefaultTimeFormat = 'hh:mm A';

const DatePicker = _ReactDatePicker as typeof ReactDatePicker;

export type EuiDatePickerPopoverPlacement = ReactDatePickerProps['popperPlacement'];
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't create a whole new type and export it here. Instead just add this directly to the prop below

src/components/date_picker/date_picker.tsx Outdated Show resolved Hide resolved
Comment on lines +36 to +39
type popperPlacement =
| 'bottom'
| 'bottom-end'
| 'bottom-start'
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@elizabetdev elizabetdev changed the title Expose popperPlacement prop in EuiDatePicker Add popoverPlacement prop in EuiDatePicker Apr 21, 2020
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/

CHANGELOG.md Show resolved Hide resolved
src/components/date_picker/date_picker.tsx Show resolved Hide resolved
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

👍 Awesome! Btw, I found two other issues that this addressed as well and marked them in the summary. Thanks!

@elizabetdev
Copy link
Contributor Author

Thanks @cchaos!

@elizabetdev elizabetdev merged commit d2d69ae into elastic:master Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants