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] disable autofocus to start when selecting end-range #13550

Closed
roybarash opened this issue Jun 19, 2024 · 4 comments
Closed

[pickers] disable autofocus to start when selecting end-range #13550

roybarash opened this issue Jun 19, 2024 · 4 comments
Labels
component: date range picker This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@roybarash
Copy link

roybarash commented Jun 19, 2024

The problem in depth

Hello,

I want to stop DateRangeCalendar from jumping to start/end of the range after a selection.
Basicly, I would like the calendar to stay where it was before the selection ended and prevent the auto-focus on the new selection.

For example: when you select a start date from 3 month ago, then select today as the end date, it will jump back to the start position.

I saw that you supply the prop disableAutoMonthSwitching but it either not matching my case or it has some issues with DateRangeCalendar. It didn't work for me.

I might should point out that the component is controlled.

I would really appreciate your help with this.
Thanks

Your environment

`npx @mui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: disableAutoMonthSwitching, jump
Order ID: 91552

@roybarash roybarash added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Jun 19, 2024
@zannager zannager added component: pickers This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Jun 19, 2024
@michelengelen michelengelen added the component: date range picker This is the name of the generic UI component, not the React module! label Jun 20, 2024
@michelengelen michelengelen changed the title [question] [pickers] disable autofocus when selecting end-range Jun 20, 2024
@michelengelen michelengelen changed the title [pickers] disable autofocus when selecting end-range [pickers] disable autofocus to start when selecting end-range Jun 20, 2024
@michelengelen
Copy link
Member

@LukasTy I remember we had a similar request not too lonmg ago, but cannot find the issue atm. Do you remember?

@arthurbalduini
Copy link
Member

Hello @roybarash, indeed the disableAutoMonthSwitching prop will not fit the use case you described. Currently, it only prevents month switching after re-selecting a start date with an already set end date. I will raise this issue so we can discuss it internally and get back to you ASAP. 🙂

@arthurbalduini arthurbalduini removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 4, 2024
@LukasTy
Copy link
Member

LukasTy commented Jul 9, 2024

@roybarash, have you tried using controlled rangePosition to achieve this behavior? 🤔
Here is an example idea.

@LukasTy LukasTy added the status: waiting for author Issue with insufficient information label Jul 9, 2024
Copy link

The issue has been inactive for 7 days and has been automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date range picker This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: commercial Support request from paid users support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

No branches or pull requests

5 participants