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

[pickers] Change DateRangePicker popper anchor element #10824

Open
david-ic3 opened this issue Oct 27, 2023 · 5 comments
Open

[pickers] Change DateRangePicker popper anchor element #10824

david-ic3 opened this issue Oct 27, 2023 · 5 comments
Labels
component: pickers This is the name of the generic UI component, not the React module! support: commercial Support request from paid users waiting for 👍 Waiting for upvotes

Comments

@david-ic3
Copy link

david-ic3 commented Oct 27, 2023

The problem in depth 🔍

We are using a Range Date Picker where the start and end dates are one below the other one.

You can check the example in CodeSandBox ( link ) .

The issue is than when you open the DateRangeCalendar, click in 'check-in' input . The Calendar overlaps the check-out input div.

Is there a way to position the Popper below the check-out div ?

Your environment 🌎

No response

Search keywords: DatePicker popper position
Order ID: #19458

@david-ic3 david-ic3 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Oct 27, 2023
@LukasTy
Copy link
Member

LukasTy commented Oct 30, 2023

Hello @david-ic3
What do you think about such a solution?
It's not the prettiest thing in the world but seems to work. 🤔

However, I'd advise rethinking your UX strategy because such a solution produces unwanted layout shifting after date selection.
You could consider specifying the end field as the anchorEl to avoid the layout shifting.
Please note the change of where the direction: "column" is specified—it avoids the unwanted change in layout/padding.

@LukasTy LukasTy added status: waiting for author Issue with insufficient information component: pickers This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 30, 2023
@LukasTy LukasTy changed the title [question] Range Date Picker popper position [pickers] Range Date Picker popper position Oct 30, 2023
@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Oct 30, 2023
@david-ic3
Copy link
Author

@LukasTy , thanks that works. If we would like to fix it to the after date anchor, I agree is a better option , could we do it without the useMemo's ?

@LukasTy
Copy link
Member

LukasTy commented Oct 30, 2023

@david-ic3 Here is an example with statically setting the anchorEl to the end field.
I'm adding a waiting for 👍 label on this issue to understand if there is more need for an easier and more appropriate solution for changing the anchorEl. 😉

@LukasTy LukasTy added waiting for 👍 Waiting for upvotes and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 30, 2023
@LukasTy LukasTy changed the title [pickers] Range Date Picker popper position [pickers] Change Date Range Picker popper anchor element Oct 30, 2023
@LukasTy LukasTy changed the title [pickers] Change Date Range Picker popper anchor element [pickers] Change DateRangePicker popper anchor element Oct 30, 2023
@david-ic3
Copy link
Author

@LukasTy , works like a charm, thanks

@LukasTy
Copy link
Member

LukasTy commented Oct 30, 2023

works like a charm, thanks

I'm glad to hear it, but it's still not the most proper and clean solution, that's why I'm reopening this issue to give the opportunity to discuss it among the team and also wait for confirmation of how relevant this is via the 👍. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! support: commercial Support request from paid users waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

2 participants