-
Notifications
You must be signed in to change notification settings - Fork 842
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
Add popoverPlacement prop in EuiDatePicker #3359
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/ |
@@ -39,6 +39,8 @@ export const euiDatePickerDefaultTimeFormat = 'hh:mm A'; | |||
|
|||
const DatePicker = _ReactDatePicker as typeof ReactDatePicker; | |||
|
|||
export type EuiDatePickerPopoverPlacement = ReactDatePickerProps['popperPlacement']; |
There was a problem hiding this comment.
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
type popperPlacement = | ||
| 'bottom' | ||
| 'bottom-end' | ||
| 'bottom-start' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Co-Authored-By: Caroline Horn <[email protected]>
…ement-prop-to-EuiDatePicker
…ement-prop-to-EuiDatePicker
Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3359/ |
There was a problem hiding this 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!
Thanks @cchaos! |
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 bothdate_picker.tsx
file andreact-datepicker.d.ts
and I followed this example in order to expose thepopperPlacement
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.Checklist
[ ] Checked in mobile[ ] Checked for breaking changes and labeled appropriately[ ] Checked for accessibility including keyboard-only and screenreader modes