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

[DateRangePicker] Stop forcing initial focus on the first section #13068

Open
LukasTy opened this issue May 9, 2024 · 0 comments
Open

[DateRangePicker] Stop forcing initial focus on the first section #13068

LukasTy opened this issue May 9, 2024 · 0 comments
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature feature: Keyboard editing Related to the pickers keyboard edition

Comments

@LukasTy
Copy link
Member

LukasTy commented May 9, 2024

Feedback received:
After entering a date of "12/12/2024", clicking outside the input, and clicking the year, focus unexpectedly jumps to the month. This seems to be caused by this focusField call: https://github.com/mui/mui-x/blob/master/packages/x-date-pickers-pro/src/internals/hooks/useEnrichedRangePickerFieldProps.ts#L182 (by not passing a newSelectedSection, it defaults to 0). Instead of entirely omitting this call, a more conservative fix would be to simply (Inside focusField: callback in useFieldV6TextField.ts) just not call setSelectedSections(newSelectedSection) if newSelectedSection is undefined).

from https://mui.com/x/react-date-pickers/date-range-picker/#basic-usage

The suggested change has a visual change that the correct section would no longer be selected when navigating (tabbing) between inputs.

Search keywords:

@LukasTy LukasTy added component: pickers This is the name of the generic UI component, not the React module! component: DateRangePicker The React component. enhancement This is not a bug, nor a new feature feature: Keyboard editing Related to the pickers keyboard edition labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature feature: Keyboard editing Related to the pickers keyboard edition
Projects
None yet
Development

No branches or pull requests

1 participant